with reference to these two topics;
viewtopic.php?t=8243
viewtopic.php?f=5&t=8215
i also want to set a simple counter to stop system from trading for two consecutive loses intraday until the next trading day, using the following code
Code: Select all
[IntrabarOrderGeneration = false]
var: LossCount(0);
if marketposition = 0 and marketposition[1] <> 0 and positionprofit(1) < 0 then
LossCount = LossCount + 1;
if LossCount < 2 then
begin
{Trading signals.....}
end;
if date <> date[1] then
LossCount = 0;
any idea what's wrong with my code? thank you!