ExexcuteMarketOrder not working properly
Created at 26 Jan 2014, 11:41
ExexcuteMarketOrder not working properly
26 Jan 2014, 11:41
Hi, I'm a bit of time studying the creation of robots. I have a problem with the new method compared to ExexcuteMarketOrder Trade.CreateBuyMarketOrder and Trade.CreateSellMarketOrder. In fact, replacing the old-fashioned method with the new results in backtesting are different.
Spotware
27 Jan 2014, 10:04
The difference is that the old API methods are using asynchronous execution whereas ExecuteMarketOrder uses synchronous execution.
If you want to compare the two you can use ExexcuteMarketOrderAsync which uses asynchronous execution. Bear in mind that if you used OnPositionOpened with Trade.CreateBuyMarketOrder, you will have to define a callback method for ExecuteMarketOrderAsync that will be invoked when the position opens.
For instance:
Please read /forum/whats-new/1937 as well as /api/guides/trading_api for more information.
@Spotware