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

Entering at Median Price

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

    Entering at Median Price

    In Strategy Builder I am attempting to enter a medial price instead of bid, ask or close but even though the strategy is a simple crossover of two average, it skips 90%of orders. Is there a way to fix this ? Also I am entering using limit orders

    #2
    Hello Teebone21,

    Thanks for your question.

    It sounds like you are submitting the limit order when there is a crossover, but the order is getting cancelled on the next bar. The Strategy Builder will generate Managed Approach code that requires limit/stop market/stop limit order methods to be called again with each bar update to keep the order alive.

    You could consider using a boolean variable (created in Inputs and Variables) that you can set to true when the cross occurs, and then another condition that checks if the bool is true, and if it is, submit your limit order. You can then create another logical condition that will set this bool back to false when you do not want this order to be submitted.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      Hello Teebone21,

      Thanks for your question.

      It sounds like you are submitting the limit order when there is a crossover, but the order is getting cancelled on the next bar. The Strategy Builder will generate Managed Approach code that requires limit/stop market/stop limit order methods to be called again with each bar update to keep the order alive.

      You could consider using a boolean variable (created in Inputs and Variables) that you can set to true when the cross occurs, and then another condition that checks if the bool is true, and if it is, submit your limit order. You can then create another logical condition that will set this bool back to false when you do not want this order to be submitted.

      We look forward to assisting.
      thanks I will try

      Comment


        #4
        Originally posted by NinjaTrader_Jim View Post
        Hello Teebone21,

        Thanks for your question.

        It sounds like you are submitting the limit order when there is a crossover, but the order is getting cancelled on the next bar. The Strategy Builder will generate Managed Approach code that requires limit/stop market/stop limit order methods to be called again with each bar update to keep the order alive.

        You could consider using a boolean variable (created in Inputs and Variables) that you can set to true when the cross occurs, and then another condition that checks if the bool is true, and if it is, submit your limit order. You can then create another logical condition that will set this bool back to false when you do not want this order to be submitted.

        We look forward to assisting.
        would it be possible for you to send me a quick video of how to accomplish this. I am still fairly new

        Comment


          #5
          Hello Teebone21,

          I have included a demonstration for creating a bool and using it to control when a limit order should be submitted.

          Demo - https://drive.google.com/file/d/1-3P...w?usp=drivesdk

          If you have not seen our educational resources on the Strategy Builder, please see below.

          Strategy Builder 301 — https://www.youtube.com/watch?v=_KQF2Sv27oE

          Conditions examples —https://ninjatrader.com/support/help...on_builder.htm

          Actions examples — https://ninjatrader.com/support/help...us/actions.htm

          We look forward to assisting.
          JimNinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Jim View Post
            Hello Teebone21,

            I have included a demonstration for creating a bool and using it to control when a limit order should be submitted.

            Demo - https://drive.google.com/file/d/1-3P...w?usp=drivesdk

            If you have not seen our educational resources on the Strategy Builder, please see below.

            Strategy Builder 301 — https://www.youtube.com/watch?v=_KQF2Sv27oE

            Conditions examples —https://ninjatrader.com/support/help...on_builder.htm

            Actions examples — https://ninjatrader.com/support/help...us/actions.htm

            We look forward to assisting.
            Thank you for your assistance Jim. I forgot to add I need to Make Heiken Ashi the primary data series. Is this possible in strategy builder or do i have to unlock code ?

            Comment


              #7
              Hello Teebone21,

              The primary data series is the data series we apply the script to. No additional changes would be necessary to have the strategy run on Heiken Ashi bars other than setting the data series to Heiken Ashi when you are setting up the strategy.

              Note that with historical backtesting, the OHLC values of the next bar are used to simulate order fills. Heiken Ashi bars create fake values, so this can make backtesting results skewed. Also with the BarsType, the developing values with realtime data are rounded and recirculated in the BarsType's calculation.

              When using Heiken Ashi in a strategy, I suggest using an indicator instead of the BarsType.

              NinjaTrader 8 natively provides Heiken Ashi as a bar type for most common bar types (minute, tick, volume, second, day, week, month, year). This Heiken Ashi indicator is provided for the Range, Renko and any custom bar types that may be added. The indicator performs in the same manner as the NinjaTrader 7 version. 4-27-18 […]


              The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

              We look forward to assisting.
              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,609 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              9 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              19 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              6 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              16 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X