[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EL help



PureBytes Links

Trading Reference Links

Hi at all, I need a little help from someone better than me with EL.
I use 5 Min bars. I would like to inhibit the system when I already earned
that day $100.
Where is the mistake in the code below?
Very Thanks
Marcello


Inputs:    DProfit(100);
Vars:      Nbar(0), MaxProfit(False);

MaxProfit = False;
Nbar = 0;

While D = EntryDate(Nbar) Begin
    Nbar = Nbar + 1;
End;

If PositionProfit - PositionProfit(Nbar) >= DProfit Then MaxProfit = True;

If MaxProfit = False Then Begin
    .... code ....
 End Else Begin
    If MarketPosition = 1 then ExitLong ("MxPu");
    If MarketPosition = -1 then ExitShort ("MxPd");
End;