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 not entering short in strategy analyzer

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

    Strategy not entering short in strategy analyzer

    Hello, I have a strategy that is supposed to take both long and short positions, which it does properly in tick replay, however only enters long in the strategy analyzer. What could the problem be here?

    #2
    Is this a strategy that you wrote?
    Have you followed the steps in this guide?
    Have you added any Print statements to your code?

    Comment


      #3
      Hello rbeckmann05,

      Thanks for your post.

      bltdavid is correct in the information they provided.

      If the expected trade(s) are not appearing, this would indicate that the condition to place the order is not evaluating as true or the order is being ignored for other reasons.

      To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

      In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar.

      Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

      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 demonstrates how to use prints to understand behavior.

      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Vitamite, Yesterday, 12:48 PM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by aligator, Today, 02:17 PM
      0 responses
      14 views
      0 likes
      Last Post aligator  
      Started by lorem, 04-25-2024, 09:18 AM
      22 responses
      96 views
      0 likes
      Last Post lorem
      by lorem
       
      Started by sofortune, Today, 10:05 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by ETFVoyageur, 05-07-2024, 07:05 PM
      23 responses
      185 views
      0 likes
      Last Post ETFVoyageur  
      Working...
      X