Topics

Forum Topics not found

Replies

applata86
21 Aug 2019, 09:28

I would like to confirm that the "OnTick bar changed" code is working.

I'm a .NET developer with morethan 10 yrs experience now and I can tell you that there's a threading problem with your OnBar() implementation.

Please fix


@applata86

applata86
21 Aug 2019, 09:16

RE:

Panagiotis Charalampous said:

Hi Sasha,

You can try something like this

 private double _lastClose;
 protected override void OnTick()
 {
    if (MarketSeries.Close.Last(1) != _lastClose)
    {
       //Bar changed
       _lastClose = MarketSeries.Close.Last(1);
    }
 }

Best Regards,

Panagiotis

 

The section "//Bar changed" inside the IF statement is only executed once every candle right? I'm looking at this option because the OnBar() issue is still not resolved -->   https://ctrader.com/forum/calgo-support/3349?page=1#7


@applata86

applata86
21 Aug 2019, 09:07

I'm also experiencing this. Why is this still an issue? I though cTrader is a good platform. 

It's frustrating that a simple event is sometimes not firing. 


@applata86