1.5x ATR (14) lines when a particular candle is clicked

To add comments, please log in or register
Kashyap11
8
Kashyap11  

I was wondering if there was a way to click on a particular candle and have 2 horizontal lines come up, above and below the close of the candle, that are 1.5x the 14-period ATR? To be clear this would be for candles in the past.


I'm trying to quickly manually backtest some trend indicators and this way my criteria. Any help would really be appreciated.

whroeder1
18076
whroeder1  
    1. In OnChartEvent capture the CHARTEVENT_CLICK event.
                Event Handling Functions - Functions - Language Basics - MQL4 Reference
    2. Convert the X/Y to Price/Time with ChartXYToTimePrice.
                ChartXYToTimePrice - Chart Operations - MQL4 Reference
    3. Convert the time to bar index
                iBarShift - Timeseries and Indicators Access - MQL4 Reference
    4. Get the high/low/ATR of the bar, and draw it.

  1. Alternatively just write an indicator to put a small dot above/below every candle and be done.
Kashyap11
8
Kashyap11  
Thanks ... that's a bit advanced for me but I did what you said and looked for an indicator and found one called ATR Enveloped tfmt4. If you modify the MA to 1 then it creates a channel of 1.5x ATR which is pretty much what I was looking for. Thank you for responding :)
To add comments, please log in or register