Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting issue to draw line in Simulation Envi.

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

    Getting issue to draw line in Simulation Envi.

    Hi,

    I am facing an issue to draw line using ninjascript.

    Problem:
    Draw trend line between Last Maxima to current high or Last minima to current low.

    Implemented Solution:
    Start point as curBarIndex= 0 (startPtIndex) next bar i am decreasing the BarAgoIndex value and draw line between start point and endpoint(curBarIndex)

    string lineTag = "TAG" + counter;


    DrawLine(lineTag,startPtIndex,startPointY , curBarIndex, endPointY,Color.DarkKhaki);

    Lines are not drawn properly as per requirement. Initially all lines are drawn in the initial area in the chart section (BackTesting).

    Kindly help.


    Regards,
    Ziaul

    #2
    Hello Ziaul,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Please provide the code snippets you use to determine the startPointY and endPointY.

    I look forward to your response.

    Comment


      #3
      startPointY -- Previous bar High
      endPointY -- Current bar High

      Want to draw line between previous high to current high.

      I am in confusion with StartBarsAgo, EndBarsAgo value of the Drawline function.

      Comment


        #4
        Hello Ziaul,

        Thank you for your response.

        Can you provide your code so I may test your code on my end?

        If you wish you can send your code to support[at]ninjatrader[dot]com with 'ATTN: Patrick' in the subject line and a reference to this thread: http://www.ninjatrader.com/support/f...ad.php?t=56820

        I look forward to your response.

        Comment


          #5
          Hello ziaul,

          As your request involves your private code. I will be responding to you through your personal email moving forward.

          Thank you for sending in the code sample.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            LTP is below or Up of Custom line

            Thank you very much for your reply. I have resolved the issue.

            I am facing another challenge. Kindly check the attached screen shots.

            There I have a ORANGE color line which is drawn with two BLACK STAR points and a RIGHT ARROW points to LTP.

            I want to find out whether LTP is above the line or below the line.

            STAR point contains y value (Bar High value) and x (CurrentBar --> BarsAgo).

            Kindly let me know if any more details you require.

            Regards,
            Ziaul
            Attached Files

            Comment


              #7
              Hello ziaul,

              Thanks for your post.

              To accomplish this, you will need to have the slope of the line to find other points on the line.
              Then you can check to see if the LTP point is above or below the slope.

              Below I have added a link to a site that will help you to find the slope as well as other points.
              http://www.sparknotes.com/math/algeb...section2.rhtml

              Let me know if I can be of further assistance.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hello,

                I am already known your reply.

                Lets once again I am explaining the exact scenario.

                The two STAR point contain y (price) and x (BarsAgo) values.

                In case of LTP, y is the current price but not sure about x (CurrentBar is 0).

                My query is related to exact LTP (Last price Market data) is below/above the custom line.

                Please let me know if any more details you require.

                BR,
                Ziaul

                Comment


                  #9
                  Hello ziaul,

                  While I cannot write this code directly you may take a look at the following link on Big Mikes Trading Forum. Here there is an equation that was written to find the slope.
                  http://www.bigmiketrading.com/wiki/t...-in-indicators

                  If you would like to have this developed by a professional I recommend you contact one of our NinjaScript Consulting Partners.
                  Click Here for our NinjaScript Consultant Partners


                  Please let me know if I can be of any other assistance.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by andrewtrades, Today, 04:57 PM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  436 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X