Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to migrate PLOT code into NT8

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to migrate PLOT code into NT8

    Hi, I do need some help with migrating PLOT code into NT8. I included some old lines of code. Could anybody please be so kind and provide some sample script how this has to be be coded in NT8. Thanks.

    Best regards from Germany
    Al


    #region Plot
    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
    {
    try
    {

    if (!InHitTest)
    {

    if (swBtnP00 == true)
    {
    for (int x = 1; x <= CurrentBar; x++)
    {
    #region Period3
    vPriceX1sma = ChartControl.GetXByBarIdx(BarsArray[0], x);
    vPriceY1sma = ChartControl.GetYByValue(BarsArray[0], SMA3Line[CurrentBar - x]);
    vPriceX1ema = ChartControl.GetXByBarIdx(BarsArray[0], x);
    vPriceY1ema = ChartControl.GetYByValue(BarsArray[0], EMA3Line[CurrentBar - x]);
    vPriceX2sma = ChartControl.GetXByBarIdx(BarsArray[0], x - 1);
    vPriceY2sma = ChartControl.GetYByValue(BarsArray[0], SMA3Line[CurrentBar - (x-1)]);
    vPriceX2ema = ChartControl.GetXByBarIdx(BarsArray[0], x - 1);
    vPriceY2ema = ChartControl.GetYByValue(BarsArray[0], EMA3Line[CurrentBar - (x-1)]);
    point1 = new Point(vPriceX1sma, vPriceY1sma);
    point2 = new Point(vPriceX1ema, vPriceY1ema);
    point3 = new Point(vPriceX2ema, vPriceY2ema);
    point4 = new Point(vPriceX2sma, vPriceY2sma);
    curvePoints = new Point[]
    {
    point4,
    point3,
    point2,
    point1
    };

    if (vPriceY1sma < vPriceY2ema)
    {
    //graphics.DrawPolygon(new Pen(Color.Red, 1), curvePoints);
    graphics.FillPolygon(new SolidBrush(Color.FromArgb(VIntensity, Color.Red)), curvePoints, FillMode.Alternate);
    graphics.DrawLine(new Pen(Color.Chocolate, 1), vPriceX2sma, vPriceY2sma, vPriceX1sma, vPriceY1sma);
    }
    else
    {
    //graphics.DrawPolygon(new Pen(Color.Red, 1), curvePoints);
    graphics.FillPolygon(new SolidBrush(Color.FromArgb(VIntensity, Color.Green)), curvePoints, FillMode.Winding);
    graphics.DrawLine(new Pen(Color.Chocolate, 1), vPriceX2sma, vPriceY2sma, vPriceX1sma, vPriceY1sma);
    }
    #endregion Period3
    }
    }
    }

    }
    #region Exception
    catch (Exception ex)
    {
    Print("Unhandled exception in HCSCloudMA.Plot(): " + ex.Message);
    }
    #endregion Exception
    }
    #endregion Plot

    #2
    OnRender()

    Hi,

    It will change to OnRender().

    Look in this thread for an example script and some SharpDX reference sites:

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, Yesterday, 10:06 AM
    0 responses
    14 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    11 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    9 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    4 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    31 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X