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

Question about "touching" an indicator line

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

    Question about "touching" an indicator line

    I've got a fair bit of logic in a strategy that does a lot of CrossAbove and CrossBelow. I don't see anything in the official SDK that allows a trigger to fire "on touch" of that indicator line.

    I messed around with a couple of different ideas and they haven't worked well at all. I was wondering if anyone has a strategy or approach they could share?

    As an example here is what I'm talking about in picture form. The touch of that line would have been great here, as the CrossBelow didn't occur allowing the short to be closed.


    Thanks!

    Click image for larger version  Name:	linetouch.jpg Views:	0 Size:	266.2 KB ID:	1135262
    Attached Files

    #2
    Hello DogEars,

    Thanks for your post.

    If the line is below the price, you can check to see if the Low[0] of the bar is less than or equal to the line.

    Note: Indicator lines are calculated values and will not use the same values as the price so if you only check to see if they are equal they may never be exactly (logically) equal. For example, a price might be 3345.25 and the indicator line might be 3345.25000001 and as such, they would not be equal (from a logic perspective). This is why you would want to check for, Less or equal or greater or equal.


    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,789 views
    0 likes
    Last Post aligator  
    Started by Jimmyk, 01-26-2018, 05:19 AM
    6 responses
    837 views
    0 likes
    Last Post emuns
    by emuns
     
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,294 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    13 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    11 responses
    63 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X