Do share a code snippet to define range of a candle. I want to define if range of the current bar is greater than the range of defined number of previous bars. Range means high to low of a candle.
High_Range = (H - L) > Ref(HHV((H-L),10),-1); Low_Range = (H-L) < Ref(LLV((H-L),10), -1); High_Range = ExRem(High_Range,Low_Range); if(SelectedValue(High_Range) == 1 AND SelectedValue(C > O)) Say("Positive High Range bar for last 10 candles"); if(SelectedValue(High_Range) == 1 AND SelectedValue(C < O)) Say("Negative High Range bar for last 10 candles");
(authorized real time data vendor supporting feeds to Amibroker/Metastock and Ninjatrader)
please note, i have used period of last 10bars. You can set your own period and use in the code.
Thanks , this helped. On another note, ive put buy and sell conditions. Now instead of plotting buy sell arrows with the code that i already have, what if i want to plot dots in the middle of the body of candlestick.