1 minute chart : how to print the high of the day?  [SOLVED]

Questions about MultiCharts and user contributed studies.
vindiou
Posts: 35
Joined: 01 Jun 2011
Has thanked: 8 times
Been thanked: 3 times

1 minute chart : how to print the high of the day?

Postby vindiou » 30 Aug 2016

Hi!
I have a 1 minute chart.
I can easily print the high of each bar this way:

Code: Select all

if currentbar = 1 then ClearPrintLog;
print(datetimetostring(datetime_bar_update)," high=",h:10:5);
...but how can I print the high of the current day? and the high of the previous day?
Thanks!

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: 1 minute chart : how to print the high of the day?

Postby tony » 30 Aug 2016

HighD(0) as for the previous day I'm not sure if HighD(1) would work or if you need to have a Data2 and then reference Data2 in your signal.

vindiou
Posts: 35
Joined: 01 Jun 2011
Has thanked: 8 times
Been thanked: 3 times

Re: 1 minute chart : how to print the high of the day?

Postby vindiou » 30 Aug 2016

I tried highd(0) but it doesn't seem to work: the indicator says "calculating..." indefinitely and when I check the %cpu used by multicharts, it is at 0% !?
Same for highd(1)
Any idea what's wrong?
Thanks!

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: 1 minute chart : how to print the high of the day?  [SOLVED]

Postby tony » 30 Aug 2016

I tried highd(0) but it doesn't seem to work: the indicator says "calculating..." indefinitely and when I check the %cpu used by multicharts, it is at 0% !?
Same for highd(1)
Any idea what's wrong?
Thanks!
You likely don't have enough bars to calculate and therefore it's "waiting" for enough bars to form to yield the value of HighD(0). Make sure your chart has enough bars that go back at least through the prior session close. If you are not receiving any backtests results, then your max bars back setting likely needs to be reduced.

vindiou
Posts: 35
Joined: 01 Jun 2011
Has thanked: 8 times
Been thanked: 3 times

Re: 1 minute chart : how to print the high of the day?

Postby vindiou » 30 Aug 2016

Correct! I had to manually set maxbarsback to 1. thanks


Return to “MultiCharts”