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 kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    14 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    135 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X