Traders Laboratory - View Single Post - Easylanguage and Script Help
View Single Post
  #44 (permalink)  
Old 04-01-2008, 06:38 PM
Blu-Ray's Avatar
Blu-Ray Blu-Ray is offline
Blu-Ray is or is not online

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 395
Thanks: 89
Thanked 33 Times in 21 Posts
Re: Easylanguage and Script Help

Darknite

Here's the code you require but it has an error in it that I can seem to get rid of at the moment. As you'll see in the charts below, first one is great with entry and exits perfect, but then on the second chart, it seems to fire off an order on a second bar if the first bar had entry & profit target all within the same bar.

All I can say is try it out and let me know how you get on.

Inputs:
ProfTarget(30),StopLoss(2 ),endtime(2000);

Vars:
ShortEntry(0), Permission(0), Mintick(0), mystop(0), MP(0);

MP = marketposition;
Mintick = minmove/pricescale;

Condition1 = C[1] data3 >C[2] data3 and H data3 > H [1]data3 and H data3 > H[2] data3 and C data3 < O data3;

if condition1 and MP = 0 and time < endtime then begin
ShortEntry = Low of data2 - (1*mintick);
mystop = High of data2 + (Stoploss*mintick);
permission = 1;
end;

if permission = 1 and mro(mp=-1,7,1) = -1 then begin
SellShort next bar at ShortEntry Stop;
Permission = 0;
end;

if permission[2] = 1 then permission = 0;

if mp = -1 then begin
buytocover ("StoppedOut") next bar at mystop stop;
end;

if mp = -1 and time > endtime then setexitonclose;

setprofittarget( ProfTarget );







( Note: Set up your chart like in the pics above, 5 min of stock on data1, 30 min of stock on data2 and $INDU on data3 )

Cheers

Blu-Ray
Attached Images
File Type: png DN.png (83.5 KB, 92 views)
File Type: png DN2.png (85.0 KB, 88 views)

__________________
Remember - Take the path of least resistance.
Reply With Quote
The Following User Says Thank You to Blu-Ray For This Useful Post:
darknite999 (04-02-2008)