What's new in cAlgo API 3.0

30 Sep 2018, 18:45What's new in cAlgo API 3.0#11
danblackadderposts: 8since: 17 Sep 2017

Hi,

I see we can still not use  MarketData.GetSymbol in backtesting.

Is there any plans to update this in the future as I understand it has been sat in your request pile for the last 2 years.

Thanks,

Dan

09 Jul 2019, 08:20RE:#12
strydom5607posts: 1since: 09 Jul 2019

Spotware said:

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.

StopOut Level
Added property Account.StopOutLevel.

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.

Kind Regards,

Johannes Strydom

18 Jul 2019, 17:13#13
paolo.panicaliposts: 1since: 16 Dec 2018

Thank you Pepper Team, you do a great Job, I am the happiest man ever with Ctrader. i d love you to give some support on Ctrader+Python, it turns out that Convolutional Neural nets performs decently predicting market direction, not the price, i mean feeding the net with multivariate time series(OHLC volume others....some of them). Bottom line, if you could give some help, cz algorithmic trading doesn not work, i mean pure.....AI plus some Algo much better. Thank you you are the best!