indicator_separate_window how to change timeframe on on this indicator only?

 

I'm using 2 indicators, one is current window and the second is indicator_separate_window.

How do i change thetimeframe for the secondindicator?

I have tried:

ChartSetSymbolPeriod(
   0,     // Chart ID
   NULL,       // Symbol name
   PERIOD_H1        // Period
   );

But it changes both.

Both indicators are the standard ZIGZAG indicators provided.

Thanks.

 
paulgriffiths:

I'm using 2 indicators, one is current window and the second is indicator_separate_window.

How do i change thetimeframe for the secondindicator?

You don't. All indicators run on the chart's TF. It can read any other TF that it wants.
 

So if im using the standard zigzag how do I go about this?

Thanks.

 
paulgriffiths: how do I go about this?
About what? There are no mind reader's here.
 
whroeder1:
About what? There are no mind reader's here.

I want my second zigzag to show 1 hour timeframe.

Thanks.

 
paulgriffiths: I want my second zigzag to show 1 hour timeframe.
You can't with the standard indicator. It run on the chart's TF. Search for a MTF version, or create it.
 
whroeder1:

You can't with the standard indicator. It run on the chart's TF. Search for a MTF version, or create it.

I have the code for the zigzag indicator. So only need to modify it.

I'm ok at programming so just need to know what to change.

The zigzag indicator code uses high[] and low[] buffers. What should I use if  i want to use 1H timeframe?

Thanks.

 

Modifying it is the hard way. Every High[i] must be rewritten as iHigh(_Symbol, PERIOD_H1, iBarShift(_Symbol, PERIOD_H1, Time[i])) and you need to separate chart's bar indexes from H1 bar indexes.

Easier is to write a new indicator, get the two values using buf0[i]=iCustom(_Symbol, PERIOD_H1, ..., 0, iBarShift(_Symbol,PERIOD_H1, Time[i])) and you're done.

Reason: