Hi I am using a moving average system that goes long when short mov. avg. crosses the longer mov. avg.
Sub AGR_MOVINGAVECROSS01(SLen As Integer, LLen As Integer) Dim ShortAve As BarArray Dim LongAve As BarArray ShortAve = Average(Close, SLen,0) LongAve = Average(Close, LLen,0) If CrossesOver(ShortAve,LongAve) Then Buy("BuyEnt",1,0,Market,Day) End If
ExitLong("TakeProfitLong","BuyEnt",1,111,Limit,Day) End Sub
However sometimes the ExitLong exits a position on the same day at the same price it was opened. I am using 111 as an exit price but I have also tried using EntryPrice+'some number' and then all my trades are exited on the same day and at the same price.
What can be the reason for this, is some thing wrong with my code or the ExitLong function??
Best regards, |