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 JonesJoker, 04-22-2024, 12:23 PM
    8 responses
    41 views
    0 likes
    Last Post JonesJoker  
    Started by timko, Today, 06:45 AM
    0 responses
    3 views
    0 likes
    Last Post timko
    by timko
     
    Started by Waxavi, 04-19-2024, 02:10 AM
    2 responses
    37 views
    0 likes
    Last Post poeds
    by poeds
     
    Started by chbruno, Yesterday, 04:10 PM
    1 response
    44 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Max238, Today, 01:28 AM
    1 response
    25 views
    0 likes
    Last Post CactusMan  
    Working...
    X