If you find one MA50_10 < Min10 you set Condition10 true; thus you trade.
return false if you find any MA50_10 > Min10 return true at loop exit.
WHRoeder:
If you find one MA50_10 < Min10 you set Condition10 true; thus you trade.
return false if you find any MA50_10 > Min10 return true at loop exit.
Thank you very much sir. I finally nailed it, your cryptic comment kicked me clear on the right course though ! :P
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
Hello forum!
So the logic is: if, say, Moving Average 50 for the last 10 consecutive bars has been below each bar, then trade.
The script below though trades immediately after the first time MA50 falls below a bar, instead of waiting for 10 consecutive bars..
Any insight will be appreciated, I'm keeping fingers crossed it's only a quick fix and not a more fundamental failure in my understanding of "for" .. :P
Best,
Dan.