You need a break statement in every "branch" of the switch or deliberately order the cases in a way that makes use of its behavior. The switch is internally working like a GOTO to certain labels, each case is a label and it will jump to that label but then move on to the following labels (fall-through) until it encounters a break which will let it jump to the end of the switch.
7bit:
You need a break statement in every "branch" of the switch or deliberately order the cases in a way that makes use of its behavior. The switch is internally working like a GOTO to certain labels, each case is a label and it will jump to that label but then move on to the following labels (fall-through) until it encounters a break which will let it jump to the end of the switch.
You need a break statement in every "branch" of the switch or deliberately order the cases in a way that makes use of its behavior. The switch is internally working like a GOTO to certain labels, each case is a label and it will jump to that label but then move on to the following labels (fall-through) until it encounters a break which will let it jump to the end of the switch.
/ McKeen
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
I am using this switch in my initialization function to set currency quotes for automatic lot-size calculation.
Unfortunately it always returns 1.01 as in case #7.
What is wrong here?
---
int init() {
string BaseCurrency = StringSubstr(Symbol(),0,3);
string sQCQ;
if (BaseCurrency == "USD") { PipValue = Point * DigitMultiplier / PriceNow; sQCQ = "Not needed for calc"; }
}
----
Thanks in advance for any suggestions...
/ McKeen