MQL4 - automated forex trading   /  

Forum

Place orders quickly

Back to topics list To post a new topic, please log in or register

avatar
86
yarns90401 2007.08.01 18:57 
I bought a trading system where I need to be able to place a market order quickly. How would I do that, script? I would want to place a market order, buy or sell, with a stop loss of 15, trailing stop of 15 and take profit of 100, for the symbol of the chart.

Thanks in advance,

Ed
article

Automated Trading Championship 2008

MetaQuotes Software Corp., Forex Capital Markets LLC (FXCM), Interbank FX LLC (IBFX), FXDD and the TRADERS' magazine are glad to announce the start of preparations for the third annual Automated Trading Championship 2008.


avatar
364
Irtron 2007.08.01 22:57 
yarns90401 wrote:
I bought a trading system where I need to be able to place a market order quickly. How would I do that, script? I would want to place a market order, buy or sell, with a stop loss of 15, trailing stop of 15 and take profit of 100, for the symbol of the chart.

A script that is launched by a hot key should do.

avatar
86
yarns90401 2007.08.02 00:07 
Thank you. How do you launch a script by hot key? Suppose I have 3 charts open for different pairs, how will it know which one to operate on?

Thanks again,

Ed

avatar
364
Irtron 2007.08.02 01:08 
yarns90401 wrote:
Thank you. How do you launch a script by hot key?

Navigator context menu (by right click on the script) -> Set hotkey.


Suppose I have 3 charts open for different pairs, how will it know which one to operate on?

It won't. The script will always run on the active chart I believe.

However it's quite possible to open a position with any available symbol regardless to the current chart symbol by using real time market data provided by MarketInfo() functionality.

You might want to have three separate scripts with different symbol, position size, stoploss and takeprofit levels, etc. hardcoded in them for the sake of quickest response that are assigned to corresponding hotkeys.

Trailing stop is another issue here though and it requires a special approach.

avatar
396
ukt 2007.08.02 15:20 
yarns90401 wrote:
Thank you. How do you launch a script by hot key? Suppose I have 3 charts open for different pairs, how will it know which one to operate on?

Thanks again,

Ed
"fast" can be seen as SLOW due to Client Terminal only having one thread for issuing orders to trade server.
Having three hotkeys mapped to three hardcoded modules is perhaps nice idea but hitting three hotkeys fast will result in [at least] two failures to issue market order.
It could take varying time before this trading thread becomes free and you must be aware of [and check in code for] this...
Suggest looking at docs to determine when code will have reasonable chance success when issuing market order http://docs.mql4.com/check
Please correct me if in error - then I learn too ;-)

forgot to mention: http://docs.mql4.com/trading gives overview/background to what saying above.

Back to topics list  

To add comments, please log in or register