Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Confused on my strategy builder

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

    Confused on my strategy builder

    Hey all, been getting loads of help from this forum so thought I'd ask another one.

    I have a strategy, it starts with bool = true ,
    Tab 1 i have it set to buy when conditions are met and bool = true, then change the bool in the "do the following" so it only takes one trade, and it works.
    Tab 2 i do the opposite of tab 1.


    My issue is, when the strategy is enabled, it will always take a buy trade even when the conditions are not met. and will never take a sell when the conditions are met. I have to be doing something wrong. If there is anyone that can look at my strat to see what i am doing wrong, or can explain it in simple terms that would be appreciated. I have attached an image of my issue. In the image, the bar with the arrow was a valid sell signal but it didnt take a trade until there was a buy signal.

    I need to figure out a way to make the start of the session "flat" and then be able to take a trade in either direction. I hope this makes sense.

    Thanks for your time.
    Attached Files
    Last edited by sprks7979; 02-11-2023, 04:45 PM.

    #2
    You can check to be sure the strategy is flat by using the following screenshot.


    Click image for larger version

Name:	image.png
Views:	179
Size:	29.2 KB
ID:	1235077

    Comment


      #3
      Hello sprks7979,

      You should upload the strategy to have a look, because from a chart photo alone I can't tell what could be the problem.

      Comment


        #4
        Hello sprks7979,

        Thanks for your post.

        A strategy will only place a trade when the condition to do so it true. A trade will not be placed if the condition is false.

        As northstardaytrading mentioned, you could use the condition they shared to check if the strategy is in a flat position before placing your entry order.

        To understand how your strategy is behaving and placing orders, debugging prints should be added to the strategy.

        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).

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.

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

        Let us know if we may assist further.​​
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        131 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X