Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to use PriceActionSwingPro indicator in a strategy?

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

    How to use PriceActionSwingPro indicator in a strategy?


    Hello,

    I have imported the indicator

    Code:
    NinjaTrader.NinjaScript.Indicators.PriceActionSwing.PriceActionSwingPro paSwingPro;
    But I cannot figure out how to enable it..

    I have tried

    paSwingPro = PriceActionSwingPro("Standard",7,20,false,false,fa lse);
    paSwingPro = PriceActionSwingPro("SwingStyle.Standard",7,20,fal se,false,false);
    paSwingPro = PriceActionSwingPro(SwingStyle.Standard,7,20,fal se,false,false);

    And nothing works...
    TrendGrabber.cs 'NinjaTrader.NinjaScript.Indicators.PriceActionSwi ng.SwingStyle.Standard' is a 'field' but is used like a 'type' CS0118 32 66
    TrendGrabber.cs The name 'SwingStyle' does not exist in the current context CS0103 74 38

    This is code from the indicator itself:
    Code:
    SwingStyleType = SwingStyle.Standard;
    SwingSize = 7;
    DtbStrength = 20;
    UseCloseValues = false;
    
    IgnoreInsideBars = true;
    UseBreakouts = true;​
    Code:
            public PriceActionSwing.PriceActionSwingPro PriceActionSwingPro([B]SwingStyle swingStyleType[/B], double swingSize, int dtbStrength, bool useCloseValues, bool ignoreInsideBars, bool useBreakouts)
            {
                return PriceActionSwingPro(Input, swingStyleType, swingSize, dtbStrength, useCloseValues, ignoreInsideBars, useBreakouts);
            }​
    Attached Files
    Last edited by prisonbreaker82; 10-16-2023, 10:07 AM.

    #2
    I have also tested

    paSwingPro = PriceActionSwingPro(paSwingPro.SwingStyleType.Stan dard,7,20,false,false,false);
    TrendGrabber.cs Member 'NinjaTrader.NinjaScript.Indicators.PriceActionSwi ng.SwingStyle.Standard' cannot be accessed with an instance reference; qualify it with a type name instead CS0176 74 38

    Comment


      #3
      Hello prisonbreaker82,

      Have you tried to create a condition using this indicator by using the strategy builder and then clicking view code? If the indicator can be used that would be a simple way to generate the necessary syntax to use it.
      JesseNinjaTrader Customer Service

      Comment


        #4
        I solved it

        NinjaTrader.NinjaScript.Indicators.PriceActionSwin g.PriceActionSwingPro paSwingPro;
        NinjaTrader.NinjaScript.Indicators.PriceActionSwin g.SwingStyle swingstyle;​


        swingstyle = NinjaTrader.NinjaScript.Indicators.PriceActionSwin g.SwingStyle.Standard;
        paSwingPro = PriceActionSwingPro(swingstyle,7,20,false,false,fa lse);​

        Comment


          #5
          Hi Prisonbreaker 82,

          The priceoscillator doesn't work like the old version. Does the priceoscillator work properly in your NT 8 ?

          Comment


            #6
            Originally posted by jan1234 View Post
            Hi Prisonbreaker 82,

            The priceoscillator doesn't work like the old version. Does the priceoscillator work properly in your NT 8 ?
            Yes it does. Try use the strategy builder and start from there with the indicator and it will help you understand more about how to use the indicator inside a strategy.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Haiasi, 04-25-2024, 06:53 PM
            2 responses
            16 views
            0 likes
            Last Post Massinisa  
            Started by Creamers, Today, 05:32 AM
            0 responses
            4 views
            0 likes
            Last Post Creamers  
            Started by Segwin, 05-07-2018, 02:15 PM
            12 responses
            1,785 views
            0 likes
            Last Post Leafcutter  
            Started by poplagelu, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post poplagelu  
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,407 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Working...
            X