Code: Select all
variables:
MP(0),
Trigger(0);
MP = marketposition(0);
Trigger = Random(15);
if totaltrades = 0 then buy this bar;
if (barssinceexit(1) > 20) and (totaltrades < 32) then
begin
if (Trigger > 8) then buy this bar on close;
end;
if (MP = 1) and barssinceentry(0) >= 10 then sell this bar on Close;
what i want is Multicharts to pick a number between 1 and 15 and if that number is greater than 8 i want it to buy and keep that buy for 10 bars and then exit. and i also want Multicharts to only take a total of 32 trades and have at least 20 bars in between the exit of one trade and the entry of the next. any idea why I'm getting this error?
any help is appreciated,
shane
attached is the screen shot of the error.