
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
Haha, that is exactly what I'm doing, just with the K line from the Stochastic RSI.
I believe I have mine working exactly how I need now, but I'd be curious to take a look at yours.
I'm also not sure where to put the ArrayInitialize functions. If I put them within the for loop, my values are always 0. If I put them just before the for loop (after int limit=...) I get the same result. They also don't do anything from within my OnInit() function.
I want to correct / clarify something.
* Indicator Buffers are always initialized to EMPTY_VALUE. If you want to initialize them to a different value, you cannot do it from OnInit(). Instead, initialize them in firstRun (prev_calculated == 0).
* Arrays of type double are always initialized to 0.0 (unless explicitly defined) and can be initialized to a different value at any time after they've been declared.
I want to correct / clarify something.
* Indicator Buffers are always initialized to EMPTY_VALUE. If you want to initialize them to a different value, you cannot do it from OnInit(). Instead, initialize them in firstRun (prev_calculated == 0).
* Arrays of type double are always initialized to 0.0 (unless explicitly defined) and can be initialized to a different value at any time after they've been declared.
I totally agree!
I want to correct / clarify something.
* Indicator Buffers are always initialized to EMPTY_VALUE. If you want to initialize them to a different value, you cannot do it from OnInit(). Instead, initialize them in firstRun (prev_calculated == 0).
* Arrays of type double are always initialized to 0.0 (unless explicitly defined) and can be initialized to a different value at any time after they've been declared.
Variables need to be explicitly initialised, otherwise they will take on the previous value of the RAM they are allocated from. One may get lucky and get the previous values there that you expect, but there is no guarantee. So one should never assume and always set the values explicitly.