Global variable resets over and over again.
maniun:
Like… every incoming tick? Every incoming tick Start() will run… if you want to run only once, put the code in a Script
Hi. :) I am a beginner so please be patient. I have a simple code and I want it to run once so I add two global variables. SELL and BUY. I don't know SELL and BUY it resets and code executes over and over again, but I need the code to execute once.
| Your code | if (Close[1] < PreviousEMA50||PreviousEMA100) |
| True is non-zero | if (Close[1] < PreviousEMA50||true) |
| Anything or true is always true. | if (…||true) |
Hi. :) I am a beginner so please be patient. I have a simple code and I want it to run once so I add two global variables. SELL and BUY. I don't know SELL and BUY it resets and code executes over and over again, but I need the code to execute once.