Announcement

Collapse
No announcement yet.

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.

      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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            63 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            139 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X