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

multiple time frames in strategy. traded out of timeframe

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

    multiple time frames in strategy. traded out of timeframe

    i have multiple timeframes in my strategy. i have a timefortrade bool for the timeframes. set to false. when in the timeframe its set to true. then i have in my entry conditions timefortrade equals true. but for some reason the strategy executed out of the timeframe. and, it was right when i enabled it. the entry methods weren't even present.
    Attached Files

    #2
    Hello SteveReiza,

    Thank you for your post.

    What do you mean by the statement "the entry methods weren't even present?"
    What was the time of the execution when you enabled the strategy? What was the name of the order?

    Ultimately, you will need to utilize debugging tools such as TraceOrders and Print statements to understand this behavior and identify what parts of your strategy might need to be corrected. We have information about Trace Orders, which may be enabled on the "Default Properties" screen of the Strategy Builder, as well as a link to a video about adding prints in the builder on the following page:


    Since you are using multiple timeframes, I also suggest reviewing the following help guide page about multi-time frame scripts:


    You could add print statements to Set 1 that show the bar timestamps for each timeframe used when TimeForTrade is set to true. Another thing to consider is, when are you resetting TimeForTrade back to false? You must have a set that checks for the opposite and when it is outside the desired timeframe to set TimeForTrade back to false, otherwise it will stay set to true after the first time it is toggled to true and this could be the culprit that resulted in a trade being taken as soon as you enabled the strategy.

    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      thanks for the reply. i mean i was looking at the chart, and i couldn't see the entry method in the strategy. but, i found the problem. in the set, 'any' was selected. so, soon as i enabled it executed because one of many conditions were true.

      okay sweet. i can print just one set - good to know! i do have timeframe set to re-read it back to false. i think i solved the problem by selecting 'all' in that one set.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rhyminkevin, Today, 04:58 PM
      3 responses
      48 views
      0 likes
      Last Post Anfedport  
      Started by iceman2018, Today, 05:07 PM
      0 responses
      5 views
      0 likes
      Last Post iceman2018  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      7 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      14 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      50 views
      0 likes
      Last Post futtrader  
      Working...
      X