TakeProfitPrice
TakeProfitPrice
13 Jan 2014, 11:13
Hi guys,
I have a robot which contains a takeprofit like this below, it worked with the old API but with the new one it does nothing:
protected override void OnPositionOpened(Position openedPosition)
{
double? TakeProfitPrice = null;
if (Positions.Count == 1)
{
position = openedPosition;
if (position.TradeType == TradeType.Buy)
TakeProfitPrice = position.EntryPrice + TakeProfit * Symbol.TickSize;
if (position.TradeType == TradeType.Sell)
TakeProfitPrice = position.EntryPrice - TakeProfit * Symbol.TickSize;
Thanks a lot for your help!
Spotware
13 Jan 2014, 14:39
Using the methods of the new API will require different syntax altogether.
Please see the examples here: /forum/whats-new/1937
Also, you can download the Trading API Guide.
One way of implementing the above would be:
@Spotware