openEquity = i_OpenEquity; //i_OpenEquity = netprofit(has been exit) + openpositionprofit(still has position)
closeEquity = i_ClosedEquity;
closeProfit = 0;
if mp <> mp[1]{this bar position changed!} and mp[1] <> 0{last bar have position} then {means new bar:1,no position or 2,opposite position} closeProfit = closeEquity - closeEquity[1]{covered earns};
if closeProfit <> 0 then begin {have earn or loss}
if closeProfit > 0 then begin {have earn}
if wlCount < 0 then wlCount = 0;{last is loss,reset time = 0}
wlCount = wlCount + 1;{earn time +1 ,the first time earn}
end;
if closeProfit < 0 then begin {have loss}
if wlCount > 0 then wlCount = 0; {last trade is earn,the reset time = 0}