Indicator: how to print buffers in the future (negative shifts) ??

 

Hi everyone,

Normally when the Buffers are printed, the minimum shift is 0. So you can only see the values from the past till now.

My goal is to print the current value of shift 0 not just now, but till the end of the day.

How can I do that ? It's an easier way to visualize for ex. Support/Resistance etc. My indicator uses an IndexStyle type DRAW_LINE.

Help is appreciated.


Thanks,

Joao

 
Joao: not just now, but till the end of the day.
You can't see the future
 

Hi Joao. If you know, in the standard Alligator indicator, three MAs are shifted forward by 3, 5 and 8 candles(bars). They programmed it this way:

void OnInit(void)
{
   IndicatorDigits(Digits);
// Setting the line shift when drawing:
   SetIndexShift(0,InpJawsShift); 
   SetIndexShift(1,InpTeethShift); 
   SetIndexShift(2,InpLipsShift); 
// Skip the first bars:
   SetIndexDrawBegin(0,InpJawsShift+InpJawsPeriod); 
   SetIndexDrawBegin(1,InpTeethShift+InpTeethPeriod); 
   SetIndexDrawBegin(2,InpLipsShift+InpLipsPeriod);

Maybe this piece of code will help you.

 
Victor Ziborov:

Hi Joao. If you know, in the standard Alligator indicator, three MAs are shifted forward by 3, 5 and 8 candles(bars). They programmed it this way:

Maybe this piece of code will help you.


Thanks Victor. You are right. Since the index cannot be negative, instead it uses the IndexShift to print the Line in the future. I guess something similar is used also in the " Ichimoku " indicator.

Will test it. Appreciated.

 
Joao Paulo Ferreira Fortes:

Thanks Victor. You are right. Since the index cannot be negative, instead it uses the IndexShift to print the Line in the future. I guess something similar is used also in the " Ichimoku " indicator.

Will test it. Appreciated.

How can I Print value in shift?
 
Adwin:
How can I Print value in shift?
Can you be more specific? You mean plot the value at shift 0 or what?
Reason: