Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 10:34:07 +0000



Custom Charts Upgrade

View Count: 217

[2024-03-07 00:11:24]
WarriorTrader - Posts: 245
Hello,

I have two custom charts that use the old school way. Is it necessary to update my code to the new objects?

Thanks,
--WT


    sc.IsCustomChart = 1; // true
    sc.GraphRegion = 0; // First region
    sc.DrawZeros = 0; // false
    sc.GraphDrawType = GDT_CANDLESTICK; //GDT_OHLCBAR;
    sc.StandardChartHeader = 1; // true


    Open.Name = "Open";
    Open.DrawStyle = DRAWSTYLE_LINE;
    Open.PrimaryColor = RGB(0, 255, 0);
    Open.DrawZeros = true;

    High.Name = "High";
    High.DrawStyle = DRAWSTYLE_LINE;
    High.PrimaryColor = RGB(0, 255, 0);
    High.DrawZeros = true;

    Low.Name = "Low";
    Low.DrawStyle = DRAWSTYLE_LINE;
    Low.PrimaryColor = RGB(255, 0, 0);
    Low.DrawZeros = true;

    Close.Name = "Last";
    Close.DrawStyle = DRAWSTYLE_LINE;
    Close.PrimaryColor = RGB(255, 0, 0);
    Close.DrawZeros = true;

    Volume.Name = "Volume";
    Volume.DrawStyle = DRAWSTYLE_IGNORE;
    Volume.PrimaryColor = RGB(255, 0, 0);
    Volume.DrawZeros = false;  

    OpenInterest.Name = "# of Trades / OI";
    OpenInterest.DrawStyle = DRAWSTYLE_IGNORE;

    OHLCAvg.Name = "OHLC Avg";
    OHLCAvg.DrawStyle = DRAWSTYLE_IGNORE;

    HLCAvg.Name = "HLC Avg";
    HLCAvg.DrawStyle = DRAWSTYLE_IGNORE;

    HLAvg.Name = "HL Avg";
    HLAvg.DrawStyle = DRAWSTYLE_IGNORE;
    

    ResizeTickHistory.Name = "Reset chart (will erase all bars)";
    ResizeTickHistory.SetYesNo(0);

    return;
  }


  const int MAX_HISTORY = 2000;

  struct s_TickHistoryType {

    int BaseIndex;
    float OpenOut;
    float HighOut;
    float LowOut;
    float CloseOut;
    float VolumeOut;

    s_TickHistoryType() : BaseIndex(0), OpenOut(0), HighOut(0), LowOut(0), CloseOut(0), VolumeOut(0) {}

  };

  struct s_CurrentBarType {

    int BaseIndex;
    float OpenOut;
    float HighOut;
    float LowOut;
    float CloseOut;
    float VolumeOut;

    s_CurrentBarType() : BaseIndex(0), OpenOut(0), HighOut(0), LowOut(0), CloseOut(0), VolumeOut(0) {}

  };

  s_TickHistoryType * TickHistory = (s_TickHistoryType *)sc.GetPersistentInt(5); //sc.PersistVars->i5;
  s_CurrentBarType * CurrentBar = (s_CurrentBarType *)sc.GetPersistentInt(8); //sc.PersistVars->i8;
  int& TickHistorySize = sc.GetPersistentInt(6); //sc.PersistVars->i6;






  if ((sc.UpdateStartIndex == 0) && (FirstBar == 0)) {

    sc.ResizeArrays(0);
    
    if (!sc.AddElements(1))
      return;

[2024-03-07 04:24:58]
Sierra_Chart Engineering - Posts: 17172
No, there is no reason to do an update if the way you are doing it is working. There is no reason why it would not in newer versions of Sierra Chart.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-03-07 04:25:10

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account