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 Mindset, Today, 06:46 AM
    0 responses
    7 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, Yesterday, 05:21 PM
    0 responses
    11 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    13 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    81 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    46 views
    0 likes
    Last Post PaulMohn  
    Working...
    X