Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swings

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

    Swings

    I would like to add a direction condition to my strategy using the recent two swings..


    Is there any way to code (for example)


    if (a higher high and a higher low exists)
    {do something}


    Or lower high and lower low, of course



    I realize that there would have to be some way to identify the past two swings. Is this possible? Maybe referencing the Swing Indicator somehow?

    #2
    Hello Pete77,

    Thanks for the note.

    You can use the MostRecentOccurance (MRO) function to find the bar where the most recent lambda occurred where lambda is the expression that you pass to MRO.

    https://ninjatrader.com/support/help...urence_mro.htm

    The Swing() indicator might also be useful for your idea:

    https://ninjatrader.com/support/help...-us/?swing.htm

    The MAX and MIN indicators will give you the maximum and minimum values of the series for the given period:

    https://ninjatrader.com/support/help...aximum_max.htm - MAX
    https://ninjatrader.com/support/help...inimum_min.htm - MIN

    Please let me know if I may be of any further assistance.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sidlercom80, Today, 04:45 AM
    0 responses
    3 views
    0 likes
    Last Post sidlercom80  
    Started by NT-Roland, Today, 04:44 AM
    0 responses
    4 views
    0 likes
    Last Post NT-Roland  
    Started by knarfoe, Today, 04:26 AM
    0 responses
    1 view
    0 likes
    Last Post knarfoe
    by knarfoe
     
    Started by manueldecastro, Yesterday, 10:59 PM
    2 responses
    9 views
    0 likes
    Last Post manueldecastro  
    Started by ttodua, 05-03-2019, 04:54 AM
    2 responses
    132 views
    0 likes
    Last Post ninZa
    by ninZa
     
    Working...
    X