Page 1 of 1

Indicator Request

PostPosted: Wed Sep 27, 2017 4:46 pm
by Muhammad87
Hi, I need your help to custom this setup.
The attached chart is 1H chart. I draw Daily and Weekly pivots on it.
I need an indicator that draw 4 rectangles which represent:
1. First Rectangle: Previous week upside tail. (High of the previous week and close or open which is nearest to high). This Rectangle is displayed on the chart for the current week.
2. Second Rectangle: Previous week downside tail. (Low of the previous week and close or open which is nearest to low). This Rectangle is displayed on the chart for the current week.
3. Third Rectangle: Previous Day upside tail. This Rectangle is displayed on the chart for the current day.
4. Fourth Rectangle: Previous day downside tail. This Rectangle is displayed on the chart for the current day.

Re: Indicator Request

PostPosted: Sun Oct 01, 2017 7:55 am
by Muhammad87
I'm trying to draw week rectangles. I hardly collect the attached code. But the following error appeared. I think the code is trying to reach an index in an array which is out of range.

An error occurred during the calculation of the indicator 'PREVIOUS_WEEK_TAILS(EUR/USD)'. The error details: C:/Program Files (x86)/Candleworks/FXTS2/Indicators/Custom/Previous_Week_Tails.lua:34: Specified index is out of range.

Re: Indicator Request

PostPosted: Mon Oct 02, 2017 5:29 am
by Apprentice

Re: Indicator Request

PostPosted: Mon Oct 02, 2017 10:07 am
by Muhammad87
Thanks for your help.
I'll try this soon.