Topics
Replies
Spotware
11 Sep 2017, 10:03
Dear trend_meanreversion,
Thanks for posting this question. There is no inherent limitation in cTrader that disallows placing/changing pending orders when markets are closed. However, during weekends maintenance is taking place and some times services might become unavailable. You could also discuss this with your broker as it could be a broker setting. Could you please provide some more information on the issue your experienced e.g. a screenshot, so we can investigate further?
Best Regards,
cTrader Team
@Spotware
Spotware
11 Sep 2017, 09:46
Dear hungtonydang,
"does the last executed order interpret the code as being the last order to enter the market or does that include pending orders as well"
In order to provide an accurate answer, we will need to see your cBot's code. But most probably the answer is no since up to now you were working with Positions and not with orders.
" I would like to know if this last executed order would carry through to all instances of the code or would they be independent"
Yes it will. If you need to separate positions between different instances, you are advised to use the label parameter when executing an order.
Best Regards,
cTrader Team
@Spotware
Spotware
11 Sep 2017, 09:08
Dear ablouwrens,
Thanks for posting in our forum. Please see the code sample below and let us know if this is what you need
var sma = Indicators.SimpleMovingAverage(MarketSeries.Median, 14); if (sma.Result.LastValue > Positions.Find("first trade label").EntryPrice) { ExecuteMarketOrder(TradeType.Buy, Symbol, 1000, "2ndTrade"); }
Best Regards,
cTrader Team
@Spotware
Spotware
07 Sep 2017, 16:29
Hi hingtonydang,
It should be placed inside the foreach loop. See below
foreach (var position in Positions) { if (Symbol.Code == position.SymbolCode) { ModifyPositionAsync(position, StopLoss, position.TakeProfit); Print("New Position SL price is {0}", position.StopLoss); } }
Best Regards,
cTrader Team
@Spotware
Spotware
07 Sep 2017, 16:25
Hi MagicTurtle,
Suppose the below scenario
EURUSD Ask Price: 1.20290 EURUSD Bid Price: 1.20270.
If you place a Buy Order with a SL of 1 pip it means that the SL is at 1.20280 which is already higher than the Bid Price. In this case the SL cannot be placed. When placing Buy orders SL should always be lower than the Bid price and placing Sell orders SL should always be higher than the Ask price.
Best Regards,
cTrader Team
@Spotware
Spotware
07 Sep 2017, 14:10
Dear Trader,
In principle this is true, since FIX API is the leanest way of trading with a cTrader account. However, you should not expect significant performance improvements since cTrader is already a performance optimized trading platform. On the contrary, if you are not familiar with code optimization techniques, your FIX API program might end up being slower than cTrader.
Best Regards,
cTrader Team
@Spotware
Spotware
07 Sep 2017, 14:04
RE:
Dear MagicTurtle,
Our team ran your algorithm for several days but we could not reproduce the message. We have explained in this discussion the reason that this message occurs, therefore this should help you troubleshoot your algorithm. If there is no easy way to reproduce the problem, there is no easy way to assist further. You are probably requesting a Stop Loss for a position that falls within the margin. You need to carefully log all the related information and check if this happens when you receive the TRADING_BAD_STOPS message.
Best Regards,
cTrader Team
@Spotware
Spotware
11 Sep 2017, 14:33
Dear forexrecon,
Thanks for posting in our forum. This is currently not available in cTrader. We will forward this as a suggestion to the relevant product team.
Best Regards,
cTrader Team
@Spotware