• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Swing indicator within an indicator

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

    Using Swing indicator within an indicator

    Hello, im trying to use Swing indicator to do divergences with MACD. How can I access the Swing indicator ? Im trying with this (with all the parameters in...) and is not working

    double hswing0=Swing(ISeries<double> input, int strength).SwingHigh(int barsAgo, 1, int lookBackPeriod) ;

    Thanks in advance.

    #2
    Hello Auxtin Maquieyra,

    Thank you for your note.

    To reference the swing indicator and the swing high, you could use the following,

    Code:
    Swing(Close, 5).SwingHigh[0];
    You could also see the example at the following link,

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

    I would suggest opening a Strategy Builder under Control Center>New >Strategy Builder, and under the Conditions section of the builder, set up a condition using the swing indicator. You could then click the unlock code button in the builder to see how the strategy builder referenced the swing indicator. I provided a screen shot of how you could go about this.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi,
      well it's working for me:
      this is mcde feed by swing:

      Print (".mcde feed by swing..=" + MACD(Swing(10).SwingHigh, 12, 26, 9)[0]);
      this one bellow, swing feed by swing for example
      Print ("..swing feed by swing..=" + Swing(Swing(10).SwingHigh, 100).SwingHigh[0]);
      more working examples feed by swings:
      Print(string.Format("{0} | SMA of SwingHigh: {1}", Time[0], SMA(Swing(10).SwingHigh, 100)[0]));
      but don't get too confortable with this, some indicators will not work with feed by swing,
      so double MACD(Swing(10).SwingHigh, 12, 26, 9)[0]; for you, should work
      B

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by TazoTodua, Today, 06:00 AM
      0 responses
      7 views
      0 likes
      Last Post TazoTodua  
      Started by Thans1946, Today, 04:04 AM
      0 responses
      5 views
      0 likes
      Last Post Thans1946  
      Started by gbux11, Today, 02:36 AM
      0 responses
      8 views
      0 likes
      Last Post gbux11
      by gbux11
       
      Started by fx.practic, Today, 01:47 AM
      0 responses
      14 views
      0 likes
      Last Post fx.practic  
      Started by bneccv, Yesterday, 09:25 PM
      0 responses
      5 views
      0 likes
      Last Post bneccv
      by bneccv
       
      Working...
      X