Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Previous Swing High

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

  • robe2010
    replied
    Originally posted by djkiwi View Post
    . What I am trying to do is get the value of that next dotted swing high target above which is not necessarily the last swing high or even 5 swing highs back. Any ideas on this one would address a long outstanding issue.

    Thanks in advance
    DJ
    Hi DJ,
    did you find the way to get the value of the next dotted swing that has not been breached??? if so, could you please share . I need to get the lastSwingHighValue to use it as a signalto enter a trade in the next retraction, as showed in the attached picture. I was able to modified the indicator to show me the entries but I can't get to the value in the strategy.
    thanks so much in advance
    Robe
    Attached Files

    Leave a comment:


  • NinjaTrader_RyanM1
    replied
    HI DJ,

    Arraylists are used in this sample.


    Unfortunately we do not have a specific example storing swing points with them.

    Leave a comment:


  • djkiwi
    replied
    Hi Austin.thanks for the examples but I am unsure how to apply them to ninjatrader. Does anybody have an example relevant to ninjatrader? For example how would this apply to the unviolated swing highs and lows?

    using System.Collections; class Program { static void Main() { // // Create an ArrayList and add three elements. // ArrayList list = new ArrayList(); list.Add("One"); list.Add("Two"); list.Add("Three"); } }

    Thanks
    DJ

    Leave a comment:


  • NinjaTrader_Austin
    replied
    Hi DJ, a quick google search yielded some samples - http://www.dotnetperls.com/arraylist.

    Leave a comment:


  • djkiwi
    replied
    Swing array

    Hi Koganam and Bertrand, does anybody have any samples on how to do this array list? I don't have a clue on where to start.

    Thanks
    DJ

    Leave a comment:


  • MrOrange
    replied
    DJ, thanks for the code! One of the segments in it did just what i wanted!

    Leave a comment:


  • koganam
    replied
    Originally posted by djkiwi View Post
    Hi Bertrand, yes exactly. How do I get the the next highest swing high above the current price? i.e one that hasn't already been breached.

    Cheers
    DJ
    You would likely have to create an ArrayList of the SwingHighs and of the SwingLows. Then test the ArrayList for the most recent Swing value that is outside the current price.

    Leave a comment:


  • djkiwi
    replied
    Swing High

    Hi Bertrand, yes exactly. How do I get the the next highest swing high above the current price? i.e one that hasn't already been breached.

    Cheers
    DJ

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    DJ, glad to hear that worked - so you're trying to get the next price value where a prior swing high / low was found?

    Leave a comment:


  • djkiwi
    replied
    Hi Bertrand, although it does work it's not doing what I want it to achieve after all. For example if you please look at the attached chart. You will see solid cyan lines below the price where the swing high has been breached I also have dotted cyan lines above the price which is the next swing high target. What I am trying to do is get the value of that next dotted swing high target above which is not necessarily the last swing high or even 5 swing highs back. Any ideas on this one would address a long outstanding issue.

    Thanks in advance
    DJ
    Attached Files

    Leave a comment:


  • djkiwi
    replied
    Swings

    Thanks Bertrand. Actually it does work after all. Here you go Mr Orange. I have put the value on the top left as per this piece of code. The values line up to my chart.

    Cheers
    DJ
    Attached Files
    Last edited by djkiwi; 09-15-2011, 08:05 PM.

    Leave a comment:


  • MrOrange
    replied
    Hey Bertrand,

    I am having a similar problem today, i hope you don't mind if i add to this thread.

    I'm simply trying to figure out (as a starting point) if the current swing high is higher or lower than the previous swing high. I would have thought this would have done it, based on the document at http://www.ninjatrader-support.com/H...ide.html?Swing

    So, here's what i tried:

    Code:
    if (High[Math.Max(0, Swing(5).SwingHighBar(0, 1, 50))] > High[Math.Max(0,Swing(5).SwingHighBar(0, 2, 50))]) Trend = Trend++;
    else Trend = Trend--;
    That didn't seem to work. I plot Trend, and it never goes above or below 0.

    I tried a few other ideas, variations of the above, but no luck. Am i missing something? Perhaps there's something about that help document i'm not getting. Do you have any idea how to accomplish this?

    Thanks!

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    DJ, please take a look at my screenshot attached - you would need to keep in mind when those levels would become accessible / known in realtime, the Swing indicator itself is more used as a visual chart aid to define market structure and as the chart progresses indicator values could be recalculated.
    Attached Files

    Leave a comment:


  • djkiwi
    replied
    Previous Swing ValuesSwing

    Hi and thanks Bertrand. Changing the instance from 1 to 2 is exactly what I did. For example this is what I tried including numerous other iterations:

    DrawTextFixed("updowntick1",(High[Math.Max(1, Swing(5).SwingHighBar(0, 2, 10))]).ToString("N1"), bPosition,Color.White,textFontLarge, Color.Black, Color.Lime, 10);

    DrawTextFixed("updowntick2",(Low[Math.Max(1, Swing(5).SwingLowBar(0, 2, 10))]).ToString("N1"), blPosition,Color.White,textFontLarge, Color.Black, Color.Lime, 10);

    Attached is the chart. I was expecting to see values of 691.5 for the previous swing high and 685.9 for the previous swing low. Instead I got 681.9 and 684.0 respectively which I cannot make sense. I tried to increase look back period from 200 to 100 but that didn't help either. Am I missing the obvious here?

    Thanks
    DJ
    Attached Files

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Hi DJ, you would then refer back to one instance higher of the Swing High Bar found - http://www.ninjatrader.com/support/h.../nt7/swing.htm

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
576 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
334 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
101 views
0 likes
Last Post Mindset
by Mindset
 
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
0 responses
553 views
1 like
Last Post Geovanny Suaza  
Started by RFrosty, 01-28-2026, 06:49 PM
0 responses
551 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X