Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 06:59:17 +0000



Post From: Last price of bar changes after refresh

[2018-01-11 23:41:37]
onnb - Posts: 661
This is a bit hard to explain so hope its clear

Summary of issue
In replay, when the live bar closes, closing price is 13047.00 - I can see this in the log below and I can see this using the tool value window.
I then refresh the chart and the closing price for that same bar changes to 13046.00

This does not happen for all bars. But for some bars, it is very 100% consistent.


Log
The first row is printed when the bar closes
I then pause the replay and refresh the chart
The second print is from that

Chart: Replay 30X: DYH18 500 Trades #1 | Study: Test Close | Last: 13047.000000 | 2018-01-11 18:33:01
Paused 30X: DYH18 500 Trades #1 | Reloading chart. | 2018-01-11 18:33:38
Chart: Paused 30X: DYH18 500 Trades #1 | Study: Test Close | Last: 13046.000000 | 2018-01-11 18:33:38

Code Used (just for reference)

SCSFExport scsf_test_close(SCStudyInterfaceRef sc)
{
  SCInputRef str1 = sc.Input[0];
  SCInputRef str2 = sc.Input[1];

  if (sc.SetDefaults)
  {

    sc.GraphName = "Test Close";
    sc.StudyDescription = "";
    sc.AutoLoop = 1;
    sc.GraphRegion = 0;
    sc.FreeDLL = 1;

    return;
  }

  if (sc.Index == sc.ArraySize - 2)
  {
    SCString msg;
    msg.Format("Last: %f", sc.BaseData[SC_LAST][sc.Index]);
    sc.AddMessageToLog(msg, 0);
  }
    

}