I wrote a simple script to plot the high and low of the initial balance period on a 30 minute chart, and it worked fine. I'm using an if statement to only examine the first hour of data after the open, then using Highest and Lowest functions to find the high and low. This requires that you input the period, or lookback length, which is no problem on the 30 minute chart - there are two bars in the first hour of trading.
Then I decided to use the indicator on a FlexRenko chart, and it got a little more complicated. Since the number of bars in the first hour will vary every day, I decided I would manually count the bars and enter it as an input. Crude, but it should be effective, I thought. Nope, that did not work, the resulting numbers did not match the hi/lo for the first hour at all. The lines were plotted on the chart, but they were not the correct values.
Then I added the same instrument to the chart, but on a 30 minute setting, ran the script using 30 minute data, and plotted the resulting lines on the FlexRenko chart. That also did not work. The lines were on the chart, but displaced a significant amount away from the real values.
Any thoughts on this? These Renko charts are odd beasts when it comes to applying indicators, I'm finding.
IBP on FlexRenko Chart
-
- Posts: 71
- Joined: 23 Nov 2015
- Has thanked: 22 times
- Been thanked: 8 times
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: IBP on FlexRenko Chart
When you put a Time-Based analysis on a Non-Time-Based chart,
the outcome is always unpredictable.
the outcome is always unpredictable.
-
- Posts: 71
- Joined: 23 Nov 2015
- Has thanked: 22 times
- Been thanked: 8 times
Re: IBP on FlexRenko Chart
Hi TJ, thanks for the reply. Can you suggest an alternative to the time-based approach?
- CrazyNasdaq
- Posts: 318
- Joined: 02 Sep 2009
- Location: ITALY
- Has thanked: 97 times
- Been thanked: 86 times
Re: IBP on FlexRenko Chart
Hi TrendFirst, you can create a counter with a condition true since time begin to time begin+30min and false after that time.
something similar to this:
This way you always have the number of bars without doing a manual count
something similar to this:
Code: Select all
vars: counter(0), initialbalnce(false), Mytime(0);
if date > date[1] then begin
Initialbalance = true;
counter = 0;
Mytime = time;
end;
if date = date[1] and time >= myTime and
time <= Mytime+30 then begin
initialbalance = true;
counter = counter+1;
end;
if date = date[1] and time >= Mytime+30 then begin
initalbalance = false;
counter = counter[1];
end;
-
- Posts: 71
- Joined: 23 Nov 2015
- Has thanked: 22 times
- Been thanked: 8 times
Re: IBP on FlexRenko Chart
Thank you CrazyNasdaq, I will review and test your idea. I haven't used counters before, so this will give me an opportunity to learn how they work.