Hello,
I'm looking for reserved words for Quarterly Open, quarterly high, quarterly low, quarterly close but i can't find them.
Does someone have a custom code for them or can help me to code them ?
I think it would be nice to have those reserved word on future versions of MC.
Regards.
MJ
Quarterly Open, High, Low, Close [SOLVED]
-
- Posts: 114
- Joined: 12 Jul 2015
- Has thanked: 20 times
- Been thanked: 16 times
- fbertram
- Posts: 166
- Joined: 16 Oct 2014
- Location: Seattle, USA
- Has thanked: 36 times
- Been thanked: 76 times
- Contact:
Re: Quarterly Open, High, Low, Close
Hi MJ,
while I no longer have a PowerLanguage version of MultiCharts available to me (I converted to .NET) and therefore can't test my response, you will need to code something along the lines of this:
I hope this gets you going,
Cheers,
Felix
while I no longer have a PowerLanguage version of MultiCharts available to me (I converted to .NET) and therefore can't test my response, you will need to code something along the lines of this:
Code: Select all
vars:
monthSeries, quarterlyHigh;
monthSeries = Month(DateTime);
if (Floor((monthSeries[0] - 1) / 4) > Floor((monthSeries[1] - 1)/4)) then begin
// a new quarter just began
quarterlyHigh = High[0];
end else begin
// we are somewhere within a quarter
quarterlyHigh = MaxList(quarterlyHigh, High[0]);
end;
Cheers,
Felix
-
- Posts: 114
- Joined: 12 Jul 2015
- Has thanked: 20 times
- Been thanked: 16 times
Re: Quarterly Open, High, Low, Close
Hello Felix,
Thank you for your help.
Here the indicator.
I'll have to customise your code to get what i want.
Thank you for your help.
Here the indicator.
I'll have to customise your code to get what i want.
-
- Posts: 114
- Joined: 12 Jul 2015
- Has thanked: 20 times
- Been thanked: 16 times
Re: Quarterly Open, High, Low, Close
This is what i want to do.
The indicator plots the high and the low of the previous month.
I need to do the same but with previous quarterly high and low.
The indicator plots the high and the low of the previous month.
I need to do the same but with previous quarterly high and low.
- fbertram
- Posts: 166
- Joined: 16 Oct 2014
- Location: Seattle, USA
- Has thanked: 36 times
- Been thanked: 76 times
- Contact:
Re: Quarterly Open, High, Low, Close
Hi MJ,
so looking at your chart it seems that you'd like a function to return the open/high/low/close of the *previous* quarter. That's easy to do, just change the code to this:
Cheers, Felix
so looking at your chart it seems that you'd like a function to return the open/high/low/close of the *previous* quarter. That's easy to do, just change the code to this:
Code: Select all
vars:
monthSeries, quarterlyHigh, prevQuarterlyHigh;
monthSeries = Month(DateTime);
if (Floor((monthSeries[0] - 1) / 4) > Floor((monthSeries[1] - 1)/4)) then begin
// a new quarter just began
prevQuarterlyHigh = quarterlyHigh;
quarterlyHigh = High[0];
end else begin
// we are somewhere within a quarter
quarterlyHigh = MaxList(quarterlyHigh, High[0]);
end;
-
- Posts: 114
- Joined: 12 Jul 2015
- Has thanked: 20 times
- Been thanked: 16 times
Re: Quarterly Open, High, Low, Close
Hi felix,Hi MJ,
so looking at your chart it seems that you'd like a function to return the open/high/low/close of the *previous* quarter. That's easy to do, just change the code to this:
Cheers, FelixCode: Select all
vars:
monthSeries, quarterlyHigh, prevQuarterlyHigh;
monthSeries = Month(DateTime);
if (Floor((monthSeries[0] - 1) / 4) > Floor((monthSeries[1] - 1)/4)) then begin
// a new quarter just began
prevQuarterlyHigh = quarterlyHigh;
quarterlyHigh = High[0];
end else begin
// we are somewhere within a quarter
quarterlyHigh = MaxList(quarterlyHigh, High[0]);
end;
Thank you for your updated code, it seems the behavior of the indicator is not good.
see the picture attached.
Regards,
MJ
-
- Posts: 114
- Joined: 12 Jul 2015
- Has thanked: 20 times
- Been thanked: 16 times
Re: Quarterly Open, High, Low, Close [SOLVED]
Hello,
I've managed to do it.
I've modified OHLCperiodago to do it.
Finally i've created HighQ and LowQ
I've managed to do it.
I've modified OHLCperiodago to do it.
Finally i've created HighQ and LowQ