JD05:
Please see https://www.mql5.com/en/docs/strings/stringsubstr
Good day,
May i just enquire if i have a string sent via Pipeline where said string goes as ""EURUSD",OP_Buy,0.1,Ask,2,0,0"
How can i split it into using String Split
Symbol="EURUSD"
cmd=OP_Buy
volume=0.1
so on so forth using the following codes

Documentation on MQL5: String Functions / StringSubstr
- www.mql5.com
String Functions / StringSubstr - Reference on algorithmic/automated trading language for MetaTrader 5
Hi Heijden,
Many thanks for the prompt reply.
Have a great day.
Regards,
JD
StringSubstr will not help you
for example
if your broker price 4 digit and your StringSubstr function calculate depended on 5 digit price
maybe your symbols have prefix like eurusd.m
it will not help you in this case so you must use your code
so in your case the code will be like this
void OnStart() { string to_split="EURUSD,OP_BUY,0.1,1.12309,3,1.12109,1.12409,mycomment"; string sep=","; ushort u_sep; string result[]; u_sep=StringGetCharacter(sep,0); int k=StringSplit(to_split,u_sep,result); string symbol=result[0]; int cmd=ordertype(result[1]); double Volume=StrToDouble(result[2]); double Price=StrToDouble(result[3]); int Slippage=StrToInteger(result[4]); double StopLoss=StrToDouble(result[5]); double TakeProfit=StrToDouble(result[6]); string Comment=result[7]; } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int ordertype(string value) { if(value=="OP_BUY")return(0); if(value=="OP_SELL")return(1); return(-1); }
Omar AlKassar:
so in your case the code will be like this
so in your case the code will be like this
Good day Omar,
Many thanks for the enlightenment.
Its really of great help.
Sincerely,
JD

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
Good day,
May i just enquire if i have a string sent via Pipeline where said string goes as ""EURUSD",OP_Buy,0.1,Ask,2,0,0"
How can i split it into using String Split
Symbol="EURUSD"
cmd=OP_Buy
volume=0.1
so on so forth using the following codes