StopLimit order
Added support for StopLimit orders.
// Place StopLimit order
PlaceStopLimitOrder(TradeType.Buy, Symbol, 10000, Symbol.Ask + 10 * Symbol.PipSize, 1);
// Get all StopLimit orders
var stopLimitOrders = PendingOrders.Where(o => o.OrderType == PendingOrderType.StopLimit);
Trailing Stop
Added support for Trailing Stop parameter.
cTrader supports Trailing Stops for positions that work on server side. Position has a boolean parameter called HasTrailingStop.
If Trailing Stop is set, StopLoss will be changed when price moves in your favor.
You can set this parameter during position opening or when placing a pending order. Also, you can change it in ModifyPosition or ModifyPendingOrder methods.
Stop trigger method
cTrader supports different Stop Trigger methods for Stop, StopLimit orders and for positions Stop Loss.
Now these parameters available via API using methods to open position, place pending orders and using modify methods.
There are 4 different trigger method:
Trade
Opposite
DoubleTrade
DoubleOpposite
AccountType
Added property Account.AccountType. It can be Netted or Hedged.
Dynamic Leverage
Now you can get multiple tiers of Symbol leverage using Symbol.DynamicLeverage.
Fractional Volumes
Up to now, cAlgo API accepted only integer values for volume in trading operations. Also some data could be accessed using integer properties only, like position volume, Symbol volume settings etc. With the introduction of cryptocurrencies, now there are instruments that can be traded using fractional units volume. To adapt to these changes, we added possibilities to work with fractional volumes using API.
For trading operations you can pass double value as volume parameter. Both integer and double values are working:
ExecuteMarketOrder(TradeType.Buy, Symbol, 1);
ExecuteMarketOrder(TradeType.Buy, Symbol, 0.5);
For volume properties we added new properties of type double, that replace old integer properties that are now deprecated.
Instead of old 'Volume' properties, you should use new 'VolumeInUints' properties. Here are some example:
Position.Volume -> Position.VolumeInUnits
HistoricalTrade.Volume -> HistoricalTrade.VolumeInUnits
Symbol.VolumeMin -> Symbol.VolumeInUnitsMin
MarketDepthEntry.Volume -> MarketDepthEntry.VolumeInUnits
etc.
Modify position volume and reverse position
Now you can change volume of existing position using ModifyPosition method
Also position could be reversed using ReversePosition method
Market Hours
Added access to Symbol trading session. You can get sessions using Symbol.MarketHours.
Connection status
Now you can get current connection status to the server using Server.IsConnected property.
Also added events Server.Connected and Server.Disconnected.
Trading events
Added new trading events:
Positions.Modified
PendingOrders.Created
PendingOrders.Modified
PendingOrders.Cancelled with cancellation reason
Also Position.Closed event now contains close reason.
Hi,
I've played around in c# and cAlgo.api version 1 or 2.
Is it possible to get a download of the 3.0 version?
Would love to get my hands dirty again with this good suff.
strydom5607
09 Jul 2019, 08:20
RE:
Spotware said:
Hi,
I've played around in c# and cAlgo.api version 1 or 2.
Is it possible to get a download of the 3.0 version?
Would love to get my hands dirty again with this good suff.
Kind Regards,
Johannes Strydom
@strydom5607