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

Help modifying my strategy

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

    Help modifying my strategy

    Hello, I am trying to get my strategy to work as I want it to but I am having difficulty with understanding variables, bool, storing prices etc. I have attached a video of the simple action I want my automated strategy to perform.

    Video: https://share.icloud.com/photos/07EN...7tp4pbi43jGTqA

    As shown in video: When the Indicator gives a signal of "2", this is determined as a breakout long. As you see above the signal bar, a horizontal entry line is made. When there is a signal of "2", I want to open a trade 1 tick above the high of that signal bar. I want the order to be placed at this level and REMAIN at that price level until the price is met or the next breakout signal occurs. If another breakout signal occurs, it would then repeat this action. Currently I can only open a trade if the bar RIGHT AFTER the signal bar breaks 1 tick above the signal bar (EnterLong[0]+1*ticksize). And if the bar RIGHT AFTER doesnt meet this level, a order is never placed. I want it to be placed regardless or not if the next bar breaks that level

    **Signal of "2" is only there for 1 bar, doesn't reoccur
    **Signal "2" is long breakout

    If anyone can help modify my attached strategy I will be very grateful, thank you!

    Strategy: (sorry, I didnt know how to download strategy so the code is a PDF attached)


    Attached Files

    #2
    Also, I have been using the Strategy Builder to make this strategy rather than writing code

    Comment


      #3
      Hello Brandon9821,

      Thanks for your post, glad you are specifying the Strategy Builder as what you are using.

      In the Strategy Builder, when you place a limit or stop order, these orders will automatically cancel if not filled on the same bar they are submitted on. Therefore to keep the order effectively in place you need to resubmit the order on each new bar until it fills or the need for the order changes.

      If you want to continue creating strategies it would be in your best interest to learn about how to use bools, how to save price into variables, If you haven't been through the educations resources for the Strategy Builder, please see:
      Free live webinar every other Thursday at 4:00 PM EST, through this link to all webinars: https://ninjatrader.com/PlatformTraining
      Previous recording of the Strategy Builder 301 webinar: https://youtu.be/HCyt90GAs9k?list=PL...auWXkWe0Nf&t=2
      Help guide for the strategy builder: https://ninjatrader.com/support/help...gy_builder.htm

      For your strategy, in the set where you are placing the order is where you would set a bool variable to true and where you would save the price that you want to submit the order. In a new set, you would have two conditions to check, is the current market position flat and is the bool true, if both conditions are true then place the order at the price saved. As long as the bool remains true and the current position is flat, the order will be resubmitted, keeping it active. Once the order fills the market position is no longer flat so the order would no longer be resubmitted, or if the bool is changed to false the order would no longer resubmitted.

      You would likely need another set with yet further conditions that would be used to then reset the bool back to false.

      To be clear we cannot provide strategy writing services and we can leave this thread open for anyone that would like to do this for you.

      Alternately if you want your strategy created for you, we can provide a reference to 3rd party programmers in the NinjaTrader ecosystem that would be able to meet your needs.
      Paul H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by f.saeidi, Today, 12:14 PM
      8 responses
      17 views
      0 likes
      Last Post f.saeidi  
      Started by Mikey_, 03-23-2024, 05:59 PM
      3 responses
      49 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Started by Russ Moreland, Today, 12:54 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by philmg, Today, 12:55 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by TradeForge, 04-19-2024, 02:09 AM
      2 responses
      32 views
      0 likes
      Last Post TradeForge  
      Working...
      X