Announcement

Collapse
No announcement yet.

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.


    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X