Hi
I think you have to declare fisrt all your variable and not in start() nor in a while loop.
Each loop reset all your variable
Matutin:
Hi
I think you have to declare fisrt all your variable and not in start() nor in a while loop.
Each loop reset all your variable
Ah!! that did it, I declared them all as global variables first and now it's holding the results.. Many thanks
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'm new to coding and have been trying to pick my way through it. I've run into something that has me stumped so would appreciate some advice.
I'm trying to find the highest price whilst the stochastic is oversold.
Using "if" I set a variable when the stoch first crosses 80 and another when it crosses back under and then want to find the highest price between the two points. My problem is that when the second condition is true, the variable set in the first condition is re set to zero. I don't understand why this is happening. I thought that a variable would hold it's value until instructed to change it. Hopefully the following code can explain. There are a load of alerts in there that I have been using to try and figure out what is going on... I've obviously done something stupid, but what am I missing??? any comments? Thanks in advance.