Can magic number be words? For example, Pin Bar,Inside Bar,and so on?
Tao Zhang:
Can magic number be words? For example, Pin Bar,Inside Bar,and so on?
Can magic number be words? For example, Pin Bar,Inside Bar,and so on?
For example,
Pin Bar=5001
Inside Bar=5002
Doji=5003
input int MagicNumberBase=5001; enum Strategy {Str_PinBar, Str_InsideBar, Str_Doji }; int StrategyToMagic(Strategy s){ return MagicNumberBase + s; } Strategy MagicToStrategy(int mn){ return Strategy(mn - MagicNumberBase); } string as_string(Strategy s, int len=0){ return StringSubstr( EnumToString(s), 4, len); }
Thanks guys, you've just helped me so much!!!
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