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

Strategy enabled but not calculating

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

    Strategy enabled but not calculating

    Hi,
    I am currently running 4 strategies simultaneously and since automation is new to me I am closely observing what might be faulty in them.
    Today I experienced something I did not before and would like to know what the cause might be:
    The strategies were set-up to trade and should have entered trades/drawn objects etc. but non of this happened despite them being enabled, synced.
    I am using IB-TWS which is restarted daily.
    What can cause behavior like this? No reloading after updating a strategy code, TWS restart, Datafeed disconnection?

    Thanks in advance;
    B.

    #2
    Hello Balage0922,

    Thanks for your post.

    If your strategy is enabled and green that would mean it is allowed to trade with realtime data. If the strategy is not taking actions you expect debugging prints should be added so you can verify:

    1. Your order methods are being reached.
    2. The logic controlling these order objects is becoming true and allowing these order methods to be reached.

    I would suggest first enabling Trace orders to see the last times the order submission methods were reached. You can also add a print next to your order methods to see that they are getting reached.

    If they are not getting reached, the logic will tell the tale. The next step would be to add prints to show the values used to evaluate your conditions. This print should be placed outside of your condition. This would tell you why the logic is not allowing the order submission method to be reached, and resolving the issue should be clear.

    More information on TraceOrders and Debugging tips is linked below.

    TraceOrders - https://ninjatrader.com/support/help...aceorders2.htm

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

    If you are seeing that your order submission logic is being reached, but is not firing, you may be hitting an internal rule of the Managed Approach.

    Managed Approach Internal Rules - https://ninjatrader.com/support/help...antedPositions

    If you see that your order submission logic is being reached, not firing, but you are not hitting an internal rule, could you post the output window seen? If you can provide a simplified version of the strategy logic that exhibits this issue, we could also give further input. We should note, the logic must be reduced to clear terms for us to give any feedback.

    We look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim,
      I never came across the managed approach section, will go trough this.
      Just another info I forgot to add, that all strategies were non respondent, which is strange and made me believe that there is some other problem than strategy logic / code bug etc. Especially that after reloading the strategies, they started to calculate. I inserted a code now where I receive an alert/print/email at first bar of session to make sure the strategy itself is online.
      B.

      Comment


        #4
        Hello Balage0922,

        Adding debugging prints will allow us to see if the logic is running, or if the logic is preventing something from occurring.

        If you do not see prints in OnBarUpdate that are not within a condition, we would know that the strategy disabled from an error, or there is not any data coming through the strategy. If there is no data coming through the strategy, I suggest opening a chart of that instrument with Chart Trader open to verify you are getting both historical data and realtime data. (Bid/Ask will change in realtime with Chart Trader open.)

        We look forward to being of further assistance.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jpapa, Today, 07:22 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by kevinenergy, 02-17-2023, 12:42 PM
        116 responses
        2,758 views
        1 like
        Last Post kevinenergy  
        Started by franatas, 12-04-2023, 03:43 AM
        7 responses
        106 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Jltarrau, Today, 05:57 AM
        3 responses
        9 views
        0 likes
        Last Post Jltarrau  
        Started by f.saeidi, Today, 05:56 AM
        2 responses
        8 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X