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

How to modify plotting behaviour of levels on trend channel

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

    How to modify plotting behaviour of levels on trend channel

    Hi,
    I cant find out how to modify this. I took a look at script but I don't find where to modify that.
    I have 4 price levels configured on trend channel (e.g. -100%, 0%, 100% and 200%)
    If I draw a descending channel, I want to show only the level that is above my trend channel (-100% level in this example). Similarly, when I draw an ascending channel, I want to show only the level that is below the trend channel (200% level).
    It's the blue lines on screenshot
    Any idea?
    Thanks
    Attached Files

    #2
    Hello ninjistu10,

    Are these plots or drawing objects?

    If they are drawing objects, you can add to the conditions that draw the object those requirements.

    With plots, you can choose not to set the plot or set it to transparent.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi ChelseaB,

      thanks for your reply

      Levels is an option under trend channel (drawing object). I know thats can turn visible/invisible with that option.
      I want modify that in trend channel script and automatize that behauviour, so I`ll dont need to check/unchek that option every time I draw an ascending/descending trend channel, but I'm not able to know what/where to modify in script
      Best,
      Attached Files

      Comment


        #4
        Hello ninjistu10,

        The code to draw a trend channel is Draw.TrendChannel().

        In what condition sets (branching commands) does this method call appear in the code?

        Below is a link to the help guide.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi,
          What I want to do is modify the "TrendChannel" script so that it has the behaviour I want when using Trend Channel tool.

          Investigating a bit I could find that script and take a look from Ninja Script Editor. But I don't have much idea of programming and I don't know what variables I should modify or what conditions I should add to the code.

          I'm trying to get this behaviour:
          - When I draw a descending channel, I want the tool only plot the line of the higher Level and not show the lower one.
          - When I draw an ascending channel, I want the tool only plot the line of the lower Level and not show the upper one.

          These lines correspond to the 1st and 4th "Price Level" property (they are the green lines).
          Attached Files

          Comment


            #6
            Hello ninjistu10,

            I'm able to guide you but I am not able to make the changes on your behalf.

            I am happy to answer any questions you may have about NinjaScript if you decide to code this yourself.

            Below is a link to a forum post with helpful information about getting started with NinjaScript.
            https://ninjatrader.com/support/foru...040#post786040

            Should you decide to make these modifications, look for Draw.TrendChannel in the script code.


            This thread will also remain open for any community members that would like to make these modifications as a convenience to you.


            You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              Thanks, I'll check those links and I'll try to create my own script to do that (or modify "TrendChannel" script).

              I guess I don't need to make it from scratch since I think that only a couple of conditions should be added or something like that.

              I'll let you know if I get stuck at some point

              BR

              Comment


                #8
                Hello,

                I have managed to modify the TrendChannel script to show/hide the price levels but something fails in my logic since I don't get it to have the proper behavior.

                And I really stuck. I think my biggest concern comes when I want to detect the direction of a vector object

                What I want is to be able to distinguish whether the direction of the vector is ascending or descending for use in a comparison such that:

                if (ascending vector)
                xxxx
                else if (descending vector)
                zzzz


                So if I draw two arrow lines in the chart (or something else), execute one action or another
                I hope you can help me (and understand my issue)


                Best
                Last edited by ninjistu10; 08-22-2019, 11:38 PM.

                Comment


                  #9
                  Hello ninjistu10,

                  Thank you for your post.

                  I would just check the TrendStartAnchor and TrendEndAnchor. For example:
                  Code:
                  if (TrendStartAnchor.GetPoint(chartControl, panel, chartScale) > TrendEndAnchor.GetPoint(chartControl, panel, chartScale)
                  {
                  // Take an action
                  }

                  Comment


                    #10
                    Hi PatrickH,

                    thanks for your reply, I'll investigate how to do it following the option you have recommended

                    Best
                    Last edited by ninjistu10; 08-22-2019, 11:38 PM.

                    Comment


                      #11
                      Hi,

                      If Im not mistaken, I have managed to understand that the 3 points used to draw the channel are: startPoint, endPoint (main line), but I am not sure what is the variable that controls the 3rd point of the parallel line (I think it's startPoint2)

                      What I need is:
                      While Im drawing the channel, once points 1 and 2 of the main line are fixed (that is, when the main line is drawn), detect if point 3 crosses the main line (the blue line in the image) while I am drawing the parallel line

                      As much as I try I can't see how to do it
                      BR
                      Attached Files

                      Comment


                        #12
                        Hello Br,

                        The TrendChannel has the TrendStartAnchor and TrendEndAnchor for the first line, and ParallelStartAnchor and ParallelEndAnchor for the second line.

                        Below is a link to the help guide.



                        However, the lines in the TrendChannel are parallel and do not cross each other.
                        Is there another line on the chart?
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by inanazsocial, Today, 01:15 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post inanazsocial  
                        Started by trilliantrader, 04-18-2024, 08:16 AM
                        5 responses
                        22 views
                        0 likes
                        Last Post trilliantrader  
                        Started by Davidtowleii, Today, 12:15 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Davidtowleii  
                        Started by guillembm, Yesterday, 11:25 AM
                        2 responses
                        9 views
                        0 likes
                        Last Post guillembm  
                        Started by junkone, 04-21-2024, 07:17 AM
                        9 responses
                        71 views
                        0 likes
                        Last Post jeronymite  
                        Working...
                        X