Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Identifying rising values with a minimum of three bars

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

    Identifying rising values with a minimum of three bars

    I'm writing this strategy on Ninjascript. I want to be able to identify when there is a series of rising low's for consecutive bars, with a minimum of three rising low's.
    I want to enter a short position when the current low is less than the previous low of the series of rising lows. (low[0] < low[1])

    My sell entry would be at the previous low (low[1])
    With the sell exit being at the current close (close[0])

    This is what I have so far.

    if rising(low(3)) and low[0] < low[1]
    Enter Short

    I've attached a picture just to better explain exactly what I want.
    Attached Files
    Last edited by pssumking93; 12-02-2019, 05:49 PM. Reason: I've highlighted the entry and exit points on the picture in Orange

    #2
    Hello pssumking93,

    Thanks for your post.

    You could use something like:

    if (Low[1] > Low[2] && Low[2] > Low[3] && Low[0] < Low[1])
    {
    // entry order here
    }

    Please note that we do not provide strategy creation services. If you would like it created for you, we can provide references to 3rd party coders who can provide that service.
    ​​​​​​​
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by thafuz, Today, 06:17 AM
    0 responses
    0 views
    0 likes
    Last Post thafuz
    by thafuz
     
    Started by timko, Today, 06:16 AM
    0 responses
    2 views
    0 likes
    Last Post timko
    by timko
     
    Started by iantriestrading, Yesterday, 10:56 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by clarocque1, 03-23-2025, 08:17 AM
    7 responses
    47 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by trdninstyle, Yesterday, 06:10 AM
    5 responses
    29 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X