Of course you do, array has no size. |
whroeder1:
What size do i need to assign it?
Of course you do, array has no size. |
Hyun Hwang: What size do i need to assign it?
| How many values are you storing in it? |
whroeder1:
Dont need many, just two i guess. One for the bar[0] and one for bar [1]
How many values are you storing in it? |
Hyun Hwang: Dont need many, just two i guess. One for the bar[0] and one for bar [1]
You guess? Why don''t you know? Look at your code:limit=(prev_calculated==0)?rates_total-period*4:rates_total-prev_calculated; Normalised15 = Normalised(limit, time, 15, period, Fly15, MA15, Stdev15, 2) ; : double Normalised(int a, ...) { double normalised []; for(int z=a; i>=0 && !_StopFlag; z--) { ... normalised[z] =
- You call your function with a=rates_total-period*4
- Z begins at a.
- You store a value at element z
- Therefor you need z+1 elements. Resize your array to a+1.
not two but thousands (slightly less than Bars)
whroeder1:
You guess? Why don''t you know? Look at your code:
So after the for loop, i need to put You guess? Why don''t you know? Look at your code:
- You call your function with a=rates_total-period*4
- Z begins at a.
- You store a value at element z
- Therefor you need z+1 elements. Resize your array to a+1.
not two but thousands (slightly less than Bars)
for {
}
ArrayResize(normalised, a+1,0)
return normalised[normalised_shift]
Is that correct?
whroeder1:
You guess? Why don''t you know? Look at your code:
Actually, without having to resize the array, can't i just lookback only the required amount of bars to compute two normalised values? This will depend on what period i use for ma and stdev so,You guess? Why don''t you know? Look at your code:
- You call your function with a=rates_total-period*4
- Z begins at a.
- You store a value at element z
- Therefor you need z+1 elements. Resize your array to a+1.
not two but thousands (slightly less than Bars)
normalise[]=2;
And use period+1 when calling normalise function instead of using 'limit'
Is that correct?
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
Hi
I normalised the distance between (EURGBP-EURUSD) and (EURUSD-GBPUSD). Below is the code;
Now, I want to create separate variables to store normalised values of other timeframes i.e 15min 60min regardless which timeframe I am currently on so I can comment those on the chart.
Can someone help on how I could retrieve normalised values from another timeframe please?
I tried creating a function, but I am getting array out of range error. Please correct me if I can use this method or let me know if there is a better way.