Hi All,
I am new to MT4. I have written a simple script to open a market order on GBPUSD. If I drag the script to the GBPUSD chart it works fine but if I double click the script when no charts are open it does nothing.
My aim is to add more lines to the script so it opens trades on more than one symbol (eurchf, eurjpy etc) so I don't want to have to drag it to a particular chart.
Hi RaptorUK, thanks for the help!
The command I am using is:
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);
which I can drag to any chart since I haven't specified a currency.
However if I use:
OrderSend("GBPUSD",OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point)
this also works but only if I drag it to the gbpusd chart. I would have thought it would work by just double clicking it since the symbol is in the command but double clicking does nothing.
Any ideas?
Thanks
Hi RaptorUK, thanks for the help!
The command I am using is:
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);
which I can drag to any chart since I haven't specified a currency.
However if I use:
OrderSend("GBPUSD",OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point)
this also works but only if I drag it to the gbpusd chart. I would have thought it would work by just double clicking it since the symbol is in the command but double clicking does nothing.
I'm afraid my scripting skills are no where near the point where I would be able to do this alone.
Would you be able to put the command together for me? :-)
Thank you!
I'm afraid my scripting skills are no where near the point where I would be able to do this alone.
Would you be able to put the command together for me? :-)
Thank you!
OrderSend("GBPUSD",OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point)
-
Can't use Ask or Bid, or Point or any other Predefined Varaiables. Can't use OnTick() as that only calls for the current chart.
-
Don't do it. Code your EA to trade the current pair only. Read the other pairs, if you need to. KISS
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I am new to MT4. I have written a simple script to open a market order on GBPUSD. If I drag the script to the GBPUSD chart it works fine but if I double click the script when no charts are open it does nothing.
My aim is to add more lines to the script so it opens trades on more than one symbol (eurchf, eurjpy etc) so I don't want to have to drag it to a particular chart.
What's the solution here?
Thanks