What's new in cAlgo API 3.0

Created at 27 Feb 2018, 10:53
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
Spotware's avatar

Spotware

Joined 23.09.2013

What's new in cAlgo API 3.0
27 Feb 2018, 10:53


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.


@Spotware
Replies

ClickAlgo
02 Mar 2018, 09:21

Nice work people, do you know when the roll-out will take place?

These are much-needed features and most welcome, thanks.

Paul Hayes
cTrader Software Vendor
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com


@ClickAlgo

afhacker
02 Mar 2018, 09:56

First thanks for adding this new features but what about community requests? where is multi-symbol backtesting? or different parameter types like Enums, date time picker,...

And is there any property to get a collection of all available symbols? that will be a simple feature to add before releasing the new version of API.

The current API library is based on .Net framework 4 which is obsolete, please update the .Net version to > 4.6 at least.

Another main issue of current API is limited drawing, please improve the API chart drawing feature by adding:

1. Transparency

2. Different shapes drawing

3. Checking current objects on chart and modifying those objects

4. A collection of objects drawn by current indicator or cBot

And please add a property to get the user platform (not system as it's available by .Net) time zone as a .Net TimeZoneInfo object.

Adding all these features will not get much time but I don't know why Spotware is very slow in adding new features?

Multi-symbol backtesting is one of the top suggestions and most voted of the community so please add it!


@afhacker

ap11
02 Mar 2018, 10:28

RE:

Hi Paul,

Thank you!

Usually, it takes a couple of weeks to test a new version on beta. After we begin to roll-out it for different brokers. 

Best Regards,
Andrey

 

Paul_Hayes said:

Nice work people, do you know when the roll-out will take place?

These are much-needed features and most welcome, thanks.

Paul Hayes
cTrader Software Vendor
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com

 


@ap11

ap11
02 Mar 2018, 11:29

RE:

Hi Afhacker,

Thank you for your feedback!

Currently, we are testing a top requested feature - Visual Backtesting. It would be in the next release.
We didn't start to work on multi-currency backtesting yet, but it is in our top priorities as a second top requested feature by the users.

We are finishing with the updated version for ChartObjects API that has the following features:

  • Get a link to the object and change object properties later
  • Check if an object is still on the chart
  • Get existing objects on the chart or indicator panel
  • Events for chart objects (added, updated, removed, hovered, selected)

Also, we have a new Color type, where you can specify transparency.

Regarding other features you mentioned.

We are planning to update .Net version in the near future. For this, we need to update cTrader to the same .Net version. Which means that we are getting rid of support for some old versions of Windows. We need to make sure that users have required .Net version installed on their machines prior to release. So we are planning to make a release with the .Net installer first, which will ask users to update. It is planned that next version will have this installer. After that we can proceed with .Net version update.

Proper parameters UI for custom enums, DateTime and Color are planned to be supported. But these tasks are not in the top priority list.

There are no plans yet to introduce new drawing objects. Your feedback on this subject is very welcome. Please tell us what do you want to see here.

Regarding TimeZone of the platform, it's a good idea to add this property and a change event.

Thank you,
Andrey

 

afhacker said:

First thanks for adding this new features but what about community requests? where is multi-symbol backtesting? or different parameter types like Enums, date time picker,...

And is there any property to get a collection of all available symbols? that will be a simple feature to add before releasing the new version of API.

The current API library is based on .Net framework 4 which is obsolete, please update the .Net version to > 4.6 at least.

Another main issue of current API is limited drawing, please improve the API chart drawing feature by adding:

1. Transparency

2. Different shapes drawing

3. Checking current objects on chart and modifying those objects

4. A collection of objects drawn by current indicator or cBot

And please add a property to get the user platform (not system as it's available by .Net) time zone as a .Net TimeZoneInfo object.

Adding all these features will not get much time but I don't know why Spotware is very slow in adding new features?

Multi-symbol backtesting is one of the top suggestions and most voted of the community so please add it!

 


@ap11

diiptrade
11 Mar 2018, 19:21

Good work!

It will be great if you can fix backtesting to show more than 2k deals and to show more logs) Also sometimes when there are a lot of deals in backtesting, it's not showing after backtesting stop. 


@diiptrade

PapaGohan
09 May 2018, 22:14

Hey great work! There is no t70 tick option though! The list shows 60, 80, 90!! The one I wanted to use is actually t70, is there any chance on adding this before the release?


@PapaGohan

leohermoso
24 May 2018, 23:58

And when it is going to be released? 


@leohermoso

PanagiotisCharalampous
25 May 2018, 12:35

Hi all,

Hopefully by the end of next week all brokers should have cTrader 3.0.

Best Regards,

Panagiotis


@PanagiotisCharalampous

lavio@gigalink.com.br
19 Jul 2018, 17:32

Editor Settings

In version 3, Calgo was integrated with CTrader. Ok... however:

1) Where are the editor settings? The default changes when saving the code format to a fixed one I hate, not very useful for many users. And I cannot change it to unselect the "auto formatting" dumb option.

2) The integrated version of Calgo has a huge problem: the optimization is now MUCH SLOWER (3x to 10x) than when the calgo executable was independent.

It is so slow that I was forced to change from tick backtests and optimizations to the M1 simulation. And this is VERY BAD !!

In fact, EVERYTHING in the "automate" section of the new CTrader 3 is VERY SLOW. Too much slow. Take attention to this guys, because it is tottaly unfeasible to work that way at a point that can force people go to other plataform. I suggest strongly to offer a Calgo independet version to those who work a lot with backtests and optimizations. I think this is a must.

3) After you optimize, the backtest does not run. Try to "apply" one optimization parameters set to the robot and then try a backtest. It does not run. You need to exit the ctrader/calgo program to make it work again on that instance.

4) The "play" buttons for backtesting and optimization does not show when it is working, active, or not. There are times you click on the button, things do not work and you do not know what is going on... you need to click again and again to be sure.

5) And old issue not related top the version 3: I already used Ninja and MT... and they do implement a true optimization algorithm. But CAlgo seems to choose the parameters randomly. Certainly it is NOT an optimization clever algorithm. In general, the optimization process is a VERY WEAK feature that lacks a better implementation in CTrader, specially when you compare it to other plataforms like MT and Ninja.

Thanks, Lavio

 


@lavio@gigalink.com.br

danblackadder
30 Sep 2018, 18:45

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


@danblackadder

strydom5607
09 Jul 2019, 08:20

RE:

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


@strydom5607

paolo.panicali
18 Jul 2019, 17:13

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!


@paolo.panicali

... Deleted by UFO ...

... Deleted by UFO ...