Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help modifying “Candlestick Indicator’s Sample” to plot Line-on-Close instead OHLC

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

    Help modifying “Candlestick Indicator’s Sample” to plot Line-on-Close instead OHLC

    I’m checking the code inside Candlestick Indicator’s Sample (link below) and I need the base idea in this indicator to plot custom charts but as Line-on-Close charts instead of OHLC bars charts, but I can’t find the way to modify this code to get only Line on Close output as plot in the chart. Yesterday for example I did some tests trying to leave only the part of ‘IndClose’ into the code, but no luck.

    Candlestick Indicator’s Sample:
    https://ninjatraderecosystem.com/user-app-share-download/candlestick-indicators-sample/


    I did several searches in the Ninjatrader Ecosystem site but I couldn’t find any indicator with a similar idea
    https://ninjatraderecosystem.com/user-app-share/?fwp_usa_search=line%20on%20close


    Could a person from the development team please help me with this? What I need is the indicator plots a basic Line-on-Close chart instead of OHLC bars chart, exactly as the default Ninjatrader "Data Series" charts properties does, with the feature to change the line width.

    I will attach a picture to have the visual idea, with the desired result on the right part

    Thank you


    Click image for larger version  Name:	Illustration - OHLC bars Chart to Line on Close Chart.png Views:	0 Size:	160.8 KB ID:	1156673
    Last edited by futurenow; 05-19-2021, 11:38 AM.

    #2
    Hi futurenow, thanks for posting.

    You can make a new indicator that simply plots the Close value to a regular plot. We will not be able to help modify a custom script, unfortunately.

    e.g.
    State.SetDefaults:
    AddPlot(Brushes.Red, "ClosePlot");

    OnBarUpdate:
    Value[0] = Close[0]; //this will draw a line on the close price.

    Best regards,
    -ChrisL

    Comment


      #3
      Thank you ChrisL for your fast reply

      Originally posted by NinjaTrader_ChrisL View Post
      e.g.
      State.SetDefaults:
      AddPlot(Brushes.Red, "ClosePlot");

      OnBarUpdate:
      Value[0] = Close[0]; //this will draw a line on the close price.
      Thank you, yes, I was trying something similar to the code portion you wrote in your answer but what I get is a blank chart, no plot anywhere, also I was trying to overlay the result I need over the OHLC chart but I couldn't get the Line-on-Close chart plot, a blank chart again.


      You can make a new indicator that simply plots the Close value to a regular plot. We will not be able to help modify a custom script, unfortunately.
      Oh! then maybe you could try with the indicator from which Candlestick Indicator’s Sample is based, that I see is Spread Indicator With Candlesticks

      This is a conversion of the Spread Indicator with Candlesticks. Please contact the original author for any questions or comments.


      I see Spread Indicator With Candlesticks is created by NinjaTrader_ChelseaB, so directly from the NT Team.

      Comment


        #4
        Hi, thanks for your reply.

        The attached script I made works fine, please try this out on your end. To run it, place the .cs file in Documents\NinjaTrader 8\bin\Custom\Indicators.

        If you do want to complete this through OnRender, our colleague Jim has made an example that mimics a plot but implemented in OnRender. I attached that example as well.

        Best regards,
        -ChrisL
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        577 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X