Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with creating a strategy from custom indicator

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

    Help with creating a strategy from custom indicator

    I would like to program a strategy to trigger longs and shorts when the the current bar crosses the entry line on the ABC portion of the PriceActionSwingPro indicator (Found Here https://www.bigmiketrading.com/ninja...iscussion.html). I have never written a strategy that refers to custom indicators so I want to know what needs to be put in the "using declarations" region, the "variables" region, etc. As far as the specific "if, thens" of the strategy i can figure out myself, but the aforementioned things are the things i need help with. This page of the thread (https://www.bigmiketrading.com/ninja...ussion-60.html) has a sample strategy written for a different version of the indicator, but I couldn't figure out what needed to be tweaked for the strategy to recognize the indicator i want to use.

    Can anyone help me? It would be a huge help and end a lot of frustrations.

    #2
    Hello sra18376,

    Thank you for your post.

    You wouldn't need to add anything for the declarations. You would call this indicator like you would call the other indicators like SMA()

    You would need to the full name of the indicator, your opening and closing parenthesis, and any inputs you need to pass through in the parenthesis

    SMA(14)
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      So it would be something as simple as

      Code:
      if (CurrentBar > PriceActionSwingPro(EntryLine))
      {
      //Do something
      }
      ??

      Would I need to declare anything specific in the variables section?

      Comment


        #4
        The only thing you would need to declare in the variables section would be a local variable that you would want to use for EntryLine.
        You can even go the next step and create a User Defined Input so that you can change this value from the strategy settings when adding it to a chart

        http://www.ninjatrader.com/support/f...ead.php?t=5782
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          So for that would it just be

          Double EntryLine

          In the variables section? How does NT know that I mean a specific indicator's EntryLine then? Thanks for the help. I know this is really elementary

          Comment


            #6
            sra18376,

            I would use this line instead for declaring the variable -

            private double entryLine = 0;

            This will create a local variable to the class only for the script.
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              OK, i got an error message and I attached a picture of my screen. The balloon that pops up when i hover over the PriceActionSwingPro makes me think that I need to declare the dtbStrength, swingSize, swingType, and useCloseValues in the variables section. Is that correct? Also, I think the swingType is an Enum in the indicator. What should I do with this enum in the strategy?


              Here is the image http://tinypic.com/view.php?pic=2mra...8#.U6-GtkBrBTs
              Last edited by sra18376; 06-28-2014, 09:37 PM.

              Comment


                #8
                Hello sra18376,

                Thank you for your response.

                You need to access the barsAgo index as well, but I would ask what you are trying to access with CurrentBar? Is this the current price you are attempting to access? If so, please use the following:
                Code:
                if(Close[0] > PriceActionSwingPro(entryLevel1)[0])

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by kevinenergy, 02-17-2023, 12:42 PM
                115 responses
                2,699 views
                1 like
                Last Post kevinenergy  
                Started by prdecast, Today, 06:07 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by Christopher_R, Today, 12:29 AM
                1 response
                14 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by chartchart, 05-19-2021, 04:14 PM
                3 responses
                577 views
                1 like
                Last Post NinjaTrader_Gaby  
                Started by bsbisme, Yesterday, 02:08 PM
                1 response
                15 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X