ubzen:
Allot of things wrong. *double he[], never sized.
There is no need, it's an Indicator buffer . . . I think some of the code is not shown, for example how a is calculated . . .
Allot of things wrong. *double he[], never sized.
RaptorUK:
There is no need, it's an Indicator buffer . . . I think some of the code is not shown, for example how a is calculated . . .
K my mistake. Do you have a good idea what he wants? My thinking is he's trying to assign Close[i + j] to i_buffers.
There is no need, it's an Indicator buffer . . . I think some of the code is not shown, for example how a is calculated . . .
ubzen:
K my mistake. Do you have a good idea what he wants? My thinking is he's trying to assign Close[i + j] to i_buffers.
I'm not sure we can see without all the code . . .
K my mistake. Do you have a good idea what he wants? My thinking is he's trying to assign Close[i + j] to i_buffers.
Thank you for the reply.
I made price[] the indicator buffer as ubzen's suggestion.
But it does not work.
It could not work because I am not so skilled.
But why it works as it is?
I cannot change the period neither on the chart with changing the parameter nor on the editor with changing the number.
I do not think the number of 20 means anything.
Does this work? Is it what you're looking for?
#property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue #property indicator_width1 STYLE_SOLID #property indicator_level1 0.5 extern int HEPeriod = 20; double he[]; int init(){ IndicatorBuffers(1); SetIndexBuffer(0, he); return(0); } int start(){ int limit=Bars-IndicatorCounted()-1; for(int j=limit; j>=0; j--){ for(int i=0; i<HEPeriod; i++){ he[i] = Close[i + j]; } } return(0); }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I use an indicator which shows a value as the object.
The value is calculated on the closed prices for the appointed period as the parameter.
I added some code lines to make it time series chart as below.
But it does not work well.
Actually it works only as it is.
But does not when the period is changed.
What is wrong?
In the original code......
<*1> double he is declared as variable, not array.
<*2> price[i] = Close[i]. j is not declared, no for statement neither.
<*3> he = a.