Indicator update delay

Created at 10 Mar 2024, 16:05
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!
SH

shakeel.saeed1

Joined 10.03.2024

Indicator update delay
10 Mar 2024, 16:05


Hi everyone,

I am a complete beginner at coding but was trying to write very basic indicators for my requirements, which I have managed to do, but then noticed something which I cant seem to get around. I was hoping someone would be kind enough to give me what could be a simple solution?

The indicators need to display current position information. When trading BTCUSD on the weekend and the ticks slow right down, so I noticed a slight delay/lag in the data. It appears to be one tick behind so isn't the most current information matching what appears in the TRADEWATCH.

These screenshots will illustrate a replication of my problem. 

and one second later:

 

As you can see, the unrealized net profit I am asking my code to print appears in the log one second/tick later. It doesn't match what the TRADEWATCH is telling me. It does the same thing in my indicator which you can see.

Here is the code I wrote to illustrate my problem:

  [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
   
    public class test : Indicator
      {     

       public override void Calculate(int index)        
       {
         Print("Profit {0}", Account.UnrealizedNetProfit);
       } 
 

Just to clarify, I have tried to modify the code to include other suggestions I have found online, such as using (IsLastBar), RefreshData(), barTick, etc.

Is there something I am missing? If I can get this simple one line of code to work in sync, I can then apply that fix to all my indicators…

 

Thank you in advance


@shakeel.saeed1
Replies

PanagiotisCharalampous
11 Mar 2024, 12:11

Hi there,

Thanks for reporting this behavior. It will be fixed in an upcoming update of the platform.

Best regards,

Panagiotis


@PanagiotisCharalampous

shakeel.saeed1
16 May 2024, 16:36 ( Updated at: 17 May 2024, 05:21 )

RE: Indicator update delay

PanagiotisCharalampous said: 

Hi there,

Thanks for reporting this behavior. It will be fixed in an upcoming update of the platform.

Best regards,

Panagiotis

Hi Panagiotis,

I appreciate your earlier response on this issue. I was waiting for the update.

However, my Ctrader has just updated and this issue has still not been resolved?

Please let me know if it has, because I cannot see it on my end.

Thanks

 


@shakeel.saeed1