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

Indicator value to a strategy execution framework

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

    Indicator value to a strategy execution framework

    Hello,Support and All!

    Is it feasible to call the indicator double value in the strategy execution framework to place limit orders?So when the signal is triggered the limit orders are placed at the indicator value level.

    Any examples or suggestions are greatly appreciated!

    #2
    Hello Outsource,

    Thank you for your note.

    Yes, its feasible to call the value of an indicator and have a limit order worked at that price while the condition is true.

    I have attached a strategy which if the close of the current bar is not the same as the close 5 bars ago, will submit a Limit order at the price of a 14 period SMA.

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

    Comment


      #3
      Originally posted by NinjaTrader_AlanP View Post
      Hello Outsource,

      Thank you for your note.

      Yes, its feasible to call the value of an indicator and have a limit order worked at that price while the condition is true.

      I have attached a strategy which if the close of the current bar is not the same as the close 5 bars ago, will submit a Limit order at the price of a 14 period SMA.

      Please let us know if you need further assistance.
      Hello,Alan!

      Thanks a lot for an example.But i think it`s for NT8,no?So far i can`t figure it out how to apply your sample to my strategy.I use NT7 at tis time.

      Comment


        #4
        Guys,i`d really appreciate if you assist me in callin the 'target double' for the attached H&S - HSIdentiy,and have a limit worked at that 'target double' value in a strategy.
        Attached Files

        Comment


          #5
          Hello Outsource,

          Thank you for your note.

          The HSIdentify indicator would need to be modified so that you could obtain the price level of the target line from within a strategy. A reference example demonstrating how you'd set this up can be found at the link below.



          I've detailed steps how you could modify the indicator so that you could obtain the target price and submit a market order at that price.

          Steps:

          Open HSIdentify and under “region Variable”, add a new data series named priceTarget.

          Code:
          private DataSeries priceTarget;
          Under Initialize you’ll need to add,

          Code:
          priceTarget	= new DataSeries(this, MaximumBarsLookBack.Infinite);
          Then under the last line of OnBarUpdate, Under HSDetect.Set(1), set priceTarget series equal to target. For example,

          Code:
          priceTarget[0] = target;
          Next, Add the following under “#region Properties”

          Code:
          [Browsable(false)]
          [XmlIgnore()]
          public DataSeries PriceTarget  //Capital X
          {
             get { return priceTarget; }  //Lowercase x.
          }
          Now from within the calling strategy, you should be able to set a variable equal to the value of the target with,

          Code:
          Double limitPriceTarget = HSIdentify(true, true,1, 5,1,true,.5).PriceTarget[0];
          Then pass this variable to EnterLongLimit method, for example,

          Code:
          EnterLongLimit(limitPriceTarget);
          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_AlanP View Post
            Hello Outsource,

            Thank you for your note.

            The HSIdentify indicator would need to be modified so that you could obtain the price level of the target line from within a strategy. A reference example demonstrating how you'd set this up can be found at the link below.



            I've detailed steps how you could modify the indicator so that you could obtain the target price and submit a market order at that price.

            Steps:

            Open HSIdentify and under “region Variable”, add a new data series named priceTarget.

            Code:
            private DataSeries priceTarget;
            Under Initialize you’ll need to add,

            Code:
            priceTarget	= new DataSeries(this, MaximumBarsLookBack.Infinite);
            Then under the last line of OnBarUpdate, Under HSDetect.Set(1), set priceTarget series equal to target. For example,

            Code:
            priceTarget[0] = target;
            Next, Add the following under “#region Properties”

            Code:
            [Browsable(false)]
            [XmlIgnore()]
            public DataSeries PriceTarget  //Capital X
            {
               get { return priceTarget; }  //Lowercase x.
            }
            Now from within the calling strategy, you should be able to set a variable equal to the value of the target with,

            Code:
            Double limitPriceTarget = HSIdentify(true, true,1, 5,1,true,.5).PriceTarget[0];
            Then pass this variable to EnterLongLimit method, for example,

            Code:
            EnterLongLimit(limitPriceTarget);
            Please let us know if you need further assistance.
            Thank you,Alan!You were very helpful.

            Cheers!

            Comment


              #7
              Hello
              Thanks for showing the whole
              strategy execution framework with an example.
              It's really helpful for me.
              Last edited by strah10; 08-13-2017, 07:35 AM. Reason: spelling mistake

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by proptrade13, Today, 11:06 AM
              0 responses
              1 view
              0 likes
              Last Post proptrade13  
              Started by kulwinder73, Today, 10:31 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by RookieTrader, Today, 09:37 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by terofs, Yesterday, 04:18 PM
              1 response
              24 views
              0 likes
              Last Post terofs
              by terofs
               
              Started by CommonWhale, Today, 09:55 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Erick  
              Working...
              X