SteveHopwood wrote:fxozgirl wrote:
Steve...BASA took a CADJPY trade yesterday after the big candle which I believe the ATR filter should have prevented? Trade went to full SL
ATR was 25, then the next candle's closed at +55 pips, so using 2x ATR should have prevented the trade? In my analysis this is how I viewed each candle, so hopefully this wasn't lost in my original presentation to you
I am using version 2p
cadjpyh4_atr filter.png
Don't know Shelley. The atr on your chart feedback is for the stop loss. There is no display for the candle length atr. The code that decides if the previous candle was too big for the candle length atr is within bool IsTradeAllowed() and seems fairly straightforward:
Code: Select all
//Previous candle length. Cancel the trade if candle moved too far
if (ClAtrPeriod > 0)
{
if (MathAbs(iClose(NULL, TradingTimeFrame, 1) - iOpen(NULL, TradingTimeFrame, 1)) > ClAtrVal) return(false);
}//if (ClAtrPeriod > 0)
but I have not included its value in the chart feedback. Shall I do so?
Note that TradingTimeFrame defaults to 0 which means the current chart and is not an input the user can edit without knowing some basic coding.
Note also that I have no idea when or why the candle length atr came to be included in all this or what it was supposed to achieve. Looked at from the point of view of someone who has no idea what it was supposed to do, it is nonsense. No doubt it made sense at the time, but it looks like nonsense now. The 'Cl' in ClAtrVal suggests to me something to do with the length of the candles over a set period of time, but I do not see how the ATR indi returns this.
Is this something that needs recoding?

Playing a bit of catch up so sorry for the delay in responding...too much on at the moment and still have 2 more days at work yet
I suspect that the criteria I provided was probably lacking...so the ATR filter which should prevent BASA taking a trade after a big spike may well need to be recoded
Hopefully I have provided a clearer explanation below and also please see chart attached:
In order for BASA to take a trade the length (in pips) of the body (ie. open/close) of the candle at Shift 1 must be less than 2 x (or user defined) the ATR at Shift 2
Also, it may be helpful to have this ATR reading recorded on the chart feedback separately from the SL ATR feedback
See the example on my chart below
cadjpy_atrfailedtrade.png
You do not have the required permissions to view the files attached to this post.