To gain a better understanding of IRT and RTL, I've attempted to write a custom projected daily range indicator.
The idea is to calculate the median daily range by day of week over the last 100 days and then draw the potential range high and range low based on the sessions current low and high as lines on an intraday chart.
I think I have a working version, but I'm not entirely sure if this was the best solution to the problem. I'd appreciate some feedback / suggestions for improvement.
I added an MPD (daily) to a new pane of the intraday chart and set it to a custom signal "MedianDailyRange" defined as SET(C#3, SESST)
with SESST set to latest price, high-low range, all bars of week, median bars at time & day, X = 100. (Is this the correct / best way to do it?)
I then added a signal to the intraday pane "ProjectedHighLowRange" SET(C#1, SESST_LOW + C#3) AND SET(C#2, SESST_HIGH - C#3)
and finally drew 2 reference lines at C#1 and C#2.
It does seem to work, but I'm wondering now if this is the best way to do it or if it could have been done easier or more efficient?
Did I completely abuse the "Signal" concept here or is this a valid use case?
Is there a way to get rid of the extra pane for the MPD? I tried adding it to the main chart but I couldn't figure out a way to not make it print anything. Is there an option to have an indicator invisible or return null? Simply "Hide"ing it in the element manager does remove the drawing, but the auto-sizing of the y-axis is still affected by the (hidden) drawing (i.e. it tries to keep it in view).
If not I assume a workaround could be to somehow return the last price from the signal, currently it only does the SET which on success seems to return 1. What would be the correct way to do a SET and return a price from a Signal?
And last but not least, is there a way to draw a "short" line starting from the beginning of the session instead of a reference line?
Thanks for any feedback, it is much appreciated!
Nic
Nic, import this chart: https://www.linnsoft.com/charts/projectedhighlow-es
and inspect what I've done there. Pretty easy to do using a combination of SESST and MPD. Again, important to use 1d* (Time Per Bar: 1 Day), instead of D/Daily bars, within MPD.
Another note, if you expand the period of 5 within the SESST for average range, you'll need to make sure your chart has a view period large enough to go back that far (if you change to 20, make sure view period is over 100 bars for 20 x 5 weeks).
Ah, I see. That makes more sense than using a signal. Thanks!
A quick question about the SESST of the MPD if that's ok though.
I can't seem to make it produce the correct value. Can you have a quick look at the settings and let me know where I'm wrong?
With these settings it seems to return always 0.
What I would have it expected to do here is:
MPD set to 1d* so one session bar made up of intraday data.
SESST set to High/Low Range of All bars of this session (which should only be 1 here due to the 1d* setting correct?) and then average it over the last 5 weeks(X=5) with the High/Low Range of the same day of week.
Obviously this is not quite the case, I just can't figure out where I'm wrong.
I also tried Last Price HI-LO, but same result.
(can't attach a picture to a reply for some reason, so here is the link)
http://imgur.com/a/jm3gw
I think in this case the "Calculate Last 2 days" in both indicators are getting in the way. If you uncheck that, does that fix?
I have fixed for next release so it will work regardless. But for now, if you want to limit to last 2 sessions, do this...
(SESST - MPD) * (POS <= 2)
where POS is seutp as "Sessions from End of Data"
That was it, thanks!