I believe that the magic number must be an int, so I do not think there is any way to add any string data directly to it. Symbol() data is represented as a string.
You could always add the string data from Symbol() to the order comments if that would work for you.
Alternatively I guess you could assign an integer value to each of the symbols you use, and somehow add that to the magic number, depending on how you are generating your magic numbers ....
Corvert Symbol to chars, convert chars to int values, concatenate them, and voilá
hmm, can you show me a example how to convert a symol?
Regards
loop over the string,
String result; for(int i=0;i<StringLen(Symbol());i++){ result=result+StringGetChar(Symbol(),i); } int resultInt = StrToInteger(result);
thanks guys, this should work
fulltilt:
is it possible to add symbol letters into magic?
fex: int MagicNumber = Symbol()12345;
- RTFM OrderSend(... comment=NULL, int magic=0, datetime expiration ..)
- Totally unnecessary Filter by MN and pair and TF if necessary
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
is it possible to add symbol letters into magic?
fex: int MagicNumber = Symbol()12345;