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

Exiting Next Bar



PureBytes Links

Trading Reference Links

Am trying to exit a trade on the day of entry using EOD if the EntryPrice -
Low of the next bar (that is on the day of entry) is greater than the stop I
have coded in.

I am using the ANYOHLC.DLL to call the next day's prices.  Generally the
code is doing as I intend, the entry and profit targets work OK,  but the
problem only occurs when the Open is nearer to the Low than to the
High/Close.

I know the order EL uses to determine the direction of price movement is
based on the closeness of the Open to the Low/High. I think that this is
preventing the exit. This is confirmed  when I look at the chart there are
situations where it should have exited at the Max_Loss  but did not.

Is there a way to force an exit at a price in this situation, I have tried
using the following example (the LongEntry is interchangeable with
EntryPrice) by inserting another exit at the start of the code.

If LongEntry - NxtLow < PointStop then LowStop = True;

IF MP <= 0  then begin
 If LowStop then Exitlong("NxtLow") at NxtLow stop;  { This does not
trigger }
 If  condition1 then buy("Long") at LongEntry  stop;    {works OK}
 ExitLong("L_Day_Prft") at LongEntry + Prft_ATR Limit; {works OK}
 ExitLong("L_Day_L") at LongEntry - Max_Loss  stop    {works OK}
End;


I have also tried changing the order of the signals to no avail


Clive