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 Akee5, Today, 12:46 PM
    0 responses
    3 views
    0 likes
    Last Post Akee5
    by Akee5
     
    Started by sdauteuil, Today, 12:44 PM
    0 responses
    1 view
    0 likes
    Last Post sdauteuil  
    Started by franco12364, Today, 12:07 PM
    1 response
    3 views
    0 likes
    Last Post sdauteuil  
    Started by glivv, Today, 09:17 AM
    0 responses
    6 views
    0 likes
    Last Post glivv
    by glivv
     
    Started by cmv727, Today, 08:48 AM
    0 responses
    10 views
    0 likes
    Last Post cmv727
    by cmv727
     
    Working...
    X