Topics
16 Nov 2023, 07:42
 1093
 1
15 Nov 2023, 10:36
 1973
 16
Replies

Spotware
20 Mar 2014, 14:02

cAlgo.API doesn't contain advanced take profit functionality.


@Spotware

Spotware
19 Mar 2014, 14:25

RE:

AlexanderRC said:

There are no guaranties of internal cAlgo/cTrader code to be reentrant. With the approach of the timer, I would have moved all of the custom code into a separate method. That method should be called from OnTimedEvent(), OnTick() and OnBar(). That method should include some sort of synchronization primitive to guard against simultaneous invocation from OnTick()/OnBar() and from OnTimedEvent().

But even that does not guarantee that you do not go through some non-reentrant internal code paths when executing that method from OnTimedEvent().

AlexanderRC is right. Please avoid of using Timer classes.

In future we will introduce cAlgo.API.Timer which will guarantee that only one thread is working with API objects.


@Spotware

Spotware
19 Mar 2014, 14:06

Hello, 

We will consider your comment about the location of percentages in the fibonacci tool. You can save a default colour for the fibonacci tool by Right Clicking on it's settings and selecting "Apply as default settings"

 

 


@Spotware

Spotware
18 Mar 2014, 10:33 ( Updated at: 21 Dec 2023, 09:20 )

You can find it at the right side of status bar:


@Spotware

Spotware
18 Mar 2014, 10:13

We have checked everything one more time. History is supported in backtesting.


@Spotware

Spotware
18 Mar 2014, 10:05

So if using a timer isn't safe, data isn't updated inside a loop and there is no event triggered for pending orders, how do you suggest that one writes code to be instantly notified of changes to pending orders?

You can not implement it in current version of API


@Spotware

Spotware
18 Mar 2014, 09:14

RE:

tekASH said:

Hello Admin

today while opening cTrader I was asked to download updates of 12.5 mb...usually, after installign updates it shows what's new....but this it didnt. What novelties are installed lately?

note: I had installed February updates prior to this one.

cTrader had to to be updated, because we extended cAlgo.API. History collection was added.
cTrader was optimized and several minor issues were fixed in last release.


@Spotware

Spotware
17 Mar 2014, 17:35

At the moment you can use only Positions.Opened and Positions.Closed events. You can post your idea to vote.spotware.com.


@Spotware

Spotware
17 Mar 2014, 17:32

System.Timers.Timer uses ThreadPool threads. Please avoid using System.Timers.Timer because while you are accessing cAlgo.API objects from timer's thread, cAlgo could decide to update such objects from another thread. In such case there is a possibility that data will be corrupted and entire application could fail.

We are going to implement cAlgo.API.Timer which will guarantee that only one thread works with API objects per time.


@Spotware

Spotware
17 Mar 2014, 17:31

System.Timers.Timer uses ThreadPool threads. Please avoid using System.Timers.Timer because while you are accessing cAlgo.API objects from timer's thread, cAlgo could decide to update such objects from another thread. In such case there is a possibility that data will be corrupted and entire application could fail.

We are going to implement cAlgo.API.Timer which will guarantee that only one thread works with API objects per time.


@Spotware

Spotware
17 Mar 2014, 16:18

We use "Bytes Received" and "Bytes Sent" performance counters. By some reason they are missing on your machine.


@Spotware

Spotware
17 Mar 2014, 14:13

Traffic in and traffic out are hidden in case if our application can not find some PerformanceCounters in your operation system.


@Spotware

Spotware
17 Mar 2014, 14:05

Yes, we have market range for stop orders feature in our road map.


@Spotware

Spotware
17 Mar 2014, 11:13

Thank you for your report. We will investigate this problem.

If you observe such issue one more time please press Shift+Ctrl+Alt+T. It will send us troubleshooting information.


@Spotware

Spotware
17 Mar 2014, 10:22

RE:

madopter said:

I would like to make the move from MT4 to cTrader/cAlgo but tick-testing is a must-have. It's a deal-breaker for me as long as it's not available -- is there any estimate regarding when tick-testing would be implemented in cAlgo?

This feature is in our short term roadmap. We are going to release it in couple of months.


@Spotware

Spotware
17 Mar 2014, 10:18

There is no such functionality at the moment. We have plans to support enum parameters in the future.


@Spotware

Spotware
17 Mar 2014, 10:15

cTrader Web doesn't support custom indicators. You can use custom indicators only in desktop version of cTrader and cAlgo.


@Spotware

Spotware
17 Mar 2014, 10:05

No, it wasn't. Currently we are not going to remove such limitation.

If you want to reuse some code it is recommended to extract such code to class library and reference it from other cBots.


@Spotware

Spotware
17 Mar 2014, 09:57

OnTick method is invoked when platform receives new quotes for the corresponding symbol.

Using of System.Threading.Timer class is not recommended, because its callback is invoked in different thread, while cAlgo.API is not thread safe. It could cause crash of application.

If you want to invoke OnTick handler more frequently than ticks come, you can subscribe OnTick handler to MarketDepth.Updated event.

For example:

protected override void OnStart()
{
  MarketData.GetMarketDepth(Symbol).Updated += OnTick;
}

In this case OnTick handler will be invoked on any update of DOM.


@Spotware

Spotware
14 Mar 2014, 16:49

You can use the following code snippet:

var buyCount = Positions.Where(p => p.TradeType == TradeType.Buy).Count();
var sellCount = Positions.Where(p => p.TradeType == TradeType.Sell).Count();

 


@Spotware