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 cls71, Today, 04:45 AM
    0 responses
    1 view
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    213 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    544 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    12 views
    0 likes
    Last Post XXtrader  
    Working...
    X