Code: Select all
MP = marketposition(0);
Trigger = Random(15);
if totaltrades = 0 then buy this bar;
if (barssinceexit(1) > 20) and (totaltrades < 32) then
if (Trigger > 8) then buy this bar on close;
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,
attached is the screen shot of the error.