Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

draw horizontal lines based on particular bar high low open close

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

    draw horizontal lines based on particular bar high low open close

    Hi everyone. I'd like to know how I should go about creating an indicator that takes a range chart for instance, and for each session excluding the current session, draw horizontal lines on the ohlc of the bar with highest volume (of that session), I haven't been able to find similar indicators, and I'm having trouble visualizing the simplest way

    #2
    Hello sampras010,

    Thank you for the post.

    I am reviewing your inquiry and will be back with a reply shortly.

    I look forward to assisting further.
    Last edited by NinjaTrader_ChrisL; 07-14-2017, 01:31 PM.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,
      I'm still trying to get this to work. I tried first to change the color of the bar with highest volume for each session


      with this code each higher bar till the highest bar are changed instead of just the highest volume bar

      private double rede ;

      protected override void OnBarUpdate()
      {


      rede = MAX(Volume, Bars.BarsSinceSession - 1)[0];

      if ( Bars.FirstBarOfSession)
      {
      rede = 0;
      }


      if( Volume[0] == rede )

      {


      BarColor= Color.Yellow;
      }


      }

      Comment


        #4
        Hello sampras010,

        Thank you for your patience.

        The attached script will draw a ray from the OHL of the highest volume bar of all previous sessions loaded on your chart.

        The script checks if the current working bar is the first updated bar of the session with Bars.IsFirstBarOfSession then draws a ray at the OHL of the highest volume of the previous session. CurrentBar keeps a count of the number of bars that have been processed. For example, if a chart has 100 bars of data, the very first bar of the chart (left most bar) will be number 0 (zero) and each subsequent bar from left to right is incremented by 1.

        More on IsFirstBarOfSession here:


        More on CurrentBar here:


        If we may be of any further assistance, please let us know.
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chris,
          I've been trying to get your script into an indicator, but I'm getting a "no suitable method found to override" error
          Attached Files
          Last edited by sampras010; 07-18-2017, 10:24 AM.

          Comment


            #6
            Hello sampras010,

            Thank you for the follow up.

            This thread is in the NinjaTrader 8 Development forum, I thought you were using NinjaTrader 8. I will move the thread to the NinjaTrader 7 forum.

            I have made a version for NinjaTrader 7 that you can try out.

            If we may be of any further assistance, please let us know.
            Attached Files
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              This has been a great experience, thanks!
              Last edited by sampras010; 07-19-2017, 02:19 AM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sidlercom80, 10-28-2023, 08:49 AM
              167 responses
              2,260 views
              0 likes
              Last Post jeronymite  
              Started by warreng86, 11-10-2020, 02:04 PM
              7 responses
              1,361 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Perr0Grande, Today, 08:16 PM
              0 responses
              5 views
              0 likes
              Last Post Perr0Grande  
              Started by elderan, Today, 08:03 PM
              0 responses
              9 views
              0 likes
              Last Post elderan
              by elderan
               
              Started by algospoke, Today, 06:40 PM
              0 responses
              10 views
              0 likes
              Last Post algospoke  
              Working...
              X