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

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:	98
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.​​
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        60 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        4 responses
        3,287 views
        1 like
        Last Post jgualdronc  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        5 views
        0 likes
        Last Post Option Whisperer  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        22 views
        0 likes
        Last Post halgo_boulder  
        Started by mishhh, 05-25-2010, 08:54 AM
        19 responses
        6,189 views
        0 likes
        Last Post rene69851  
        Working...
        X