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

Using RTH daily range to enter on a 1 min chart with Strategy Builder

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

    Using RTH daily range to enter on a 1 min chart with Strategy Builder

    I'm getting stuck coding a fade entry in strategy builder.

    My entry requirements are on a 1 min chart, however I do not want to take the trade unless the current RTH daily range exceeds a certain value.

    The Daily chart for ES in NT8 is not RTH data, so I set a 1440min so it would be intraday RTH data only

    I coded the following in Strategy builder (for a long) but it does not follow this logic...any ideas:

    Default input[0] < (Open of <Primary> (1440 Minute)[0] - (Height))
    Screen shot of that input attached

    I have the "Height" input set to say 40
    So that means the Open value of the day, which should be the open of the 1440min bar - 40 is a parameter.
    Say 1440 bar opens at 4380, then 4380-40 = 4340, then 4340 is a parameter for the strategy to use

    So that means on the 1 min chart, if the current close is higher than 4340 then if should not take a long trade
    It should not take a trade because the strategy has been told the current 1 min close must be less than 4340

    That is what is coded, however the strategy is taking trades when the 1 min close is above 4340

    I also tried the "Range" indicator on 1440 min to exceed a Numeric Value, that doesn't work either

    Anyone have any ideas how to exclude trades if the daily range is less that the "height" parameter that is set in the strategy?

    thanks

    Glen
    Attached Files

    #2
    Hello glen55867,

    Thanks for your post.

    Have you added prints to the strategy to confirm the values being evaluated by the strategy to understand the strategy's behavior?

    If not, add debugging prints to the strategy that print out all of the values used for determining if an order should be placed. In the Strategy Builder, you could add prints in the Action section under Misc folder > Print.

    Prints will appear in a New > NinjaScript Editor window.

    You could also consider drawing a dot in the same Action block as your order submission. If the dot is getting drawn, then the condition is becoming true.

    Also, enable TraceOrders which will let you know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

    Below is a link to a forum post that includes a video of showing how to use prints in the strategy builder. Using prints in the Strategy Builder is a powerful way to quickly find where issues are occurring and why.

    https://ninjatrader.com/support/foru...121#post791121

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Brandon

      Thank you for your response

      I have followed your suggestions and there are no error messages in the Editor window.

      I tested the logic for the height range limit, and it does work when the height limit logic, and trade entry parameters are on the same timeframe data series.

      So the logic does work, it just doesn't work when the trade entry parameter is on a small timeframe (1 min in my case), and the height limit logic s on an Additional Data series that is a larger timeframe (1440 min in my case)

      So any ideas on how the strategy builder can use an additional data series in this case?

      thanks

      Glen

      Comment


        #4
        Hello glen55867,

        Thanks for your note.

        I understand that your script works when all the script's logic is running on the primary timeframe.

        Could you confirm that you have added prints that print out the values being calculated by the added secondary series when using the added series for your order entry condition calculations? When comparing these prints, do you see your order conditions returning true?

        Do you have TraceOrders enabled? TraceOrders will let you know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

        Prints would need to be added to the script to print out the values being calculated in the added series to see how the strategy behaves when the added series is used for your order conditions.

        Debugging with Prints and TraceOrders: https://ninjatrader.com/support/foru...121#post791121

        Note that the Strategy Builder is limited in its Multi-Timeframe/Instrument capabilities. You may need to unlock your script from the Strategy Builder and manually code the strategy to accomplish your goals.

        See this help guide for information about working with Multi-Timeframe/Instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pibrew, Today, 06:37 AM
        0 responses
        0 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Working...
        X