Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 06:01:08 +0000



Post From: bar index of ACSIL created drawing

[2015-07-09 19:42:50]
User231363 - Posts: 31
I know how to work the indexes. The issue is that when I read the ray drawings created by ACSIL, the BlockTradeLine.BeginIndex and BlockTradeLine.BeginDateTime are -1.

I'm using this code to create the rays:
    
      LastBlockTradeLineBarIndex = sc.Index;
          LastBlockTradeLinePrice = currPrice;
          Tool.Clear(); // reset tool structure for our next use
          Tool.AddAsUserDrawnDrawing = 1;
          Tool.ChartNumber = ChartNumberToDrawLines.GetInt();
          Tool.DrawingType = DRAWING_HORIZONTAL_RAY;
          //Tool.DisplayHorizontalLineValue = 1;
          Tool.LineNumber = LastBlockTradeLineNumUsed;
          Tool.BeginIndex = sc.Index;
          Tool.BeginValue = currPrice;// *sc.RealTimePriceMultiplier;
          //Tool.EndValue = Tool.BeginValue;
          Tool.Color = RGB(255, 0, 255); // Magenta
          //Tool.Text = "bid";
          Tool.LineStyle = LINESTYLE_DOT;
          //Tool.LineWidth = 3;
          Tool.AddMethod = UTAM_ADD_OR_ADJUST;
          sc.UseTool(Tool);
          SCString Buffer;
          Buffer.Format("Created line chart: %d w/line num: %d @ index:%d price:%f", Tool.ChartNumber, Tool.LineNumber, Tool.BeginIndex, Tool.BeginValue);
          sc.AddMessageToLog(Buffer, 0);

=======================================
Code to read the drawing:

      int chartsFound = sc.UserDrawnChartDrawingExists(targetChartNum, i);
      if (chartsFound > 0)
      {
        BlockTradeLine.Clear();
        sc.GetUserDrawnChartDrawing(targetChartNum, DRAWING_RAY, BlockTradeLine, 0);
        SCDateTime lineTime = BlockTradeLine.BeginDateTime;
        SCString timeStr = sc.FormatDateTime(lineTime).GetChars();
        Buffer.Format(" deleting chart: %d w/line num: %d -> index: %d, price:%f, date:%s", targetChartNum, i, BlockTradeLine.BeginIndex, BlockTradeLine.BeginValue, timeStr);
        sc.AddMessageToLog(Buffer, 0);


===================================