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

Thinking Wrong of the Order of Sets?

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

    Thinking Wrong of the Order of Sets?

    Hello, i try to make my first strategy with the Builder inside. My Strategy are two steps. first a activation signal where i put a 1 in the active variable, and in step 2 i check if the active =1 then test if the right entry signal occure. set 3 is the exit where the position are closed and the variabel active set to 0 . but this wont work. As i show in the strategy analyzer it shows only trades if i not check the active variable = 1. so i think i can not change variables value in the process of the steps?

    Maybe thinking mistake. i come from the MT4 Language where this are easy possible.
    Thank you for help. Code from the Builder is attached


    #2
    Hello orbito,

    You can assign variables new values in the condition set actions.

    Condition set 1 in your screenshot is complex. Are you seeing the dot being drawn, showing this condition has evaluated as true?

    The entry is from set 2 which does not compare the 'Active' variable, however this does require the Trade variable to be 0 along with other conditions.

    You can print this variable along with the time of the bar to confirm that the values of this is 0, along with all other values compared in the condition.

    See the video 'Debugging using prints with the Strategy Builder' in the forum post linked below on using prints to understand behavior.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      yes the dots are showing of the first step. the problem are if i set the if active =1 in set two, tham not trades will make. this is why now the active =1 inn the set 2 is missing. the error must be in set 3. if i delete the (active=0) under than trades come. but i dont understand what wrong with that. they set this active 0 only if the trade is exitr but it seems that is set directly after the activation signal of set 1 so that the trade never can open.

      Comment


        #4
        Hello orbito,

        Just to confirm, you have not provided a screenshot of the conditions you are wanting assistance with and have provided screenshots without the condition you are inquiring about?

        In the screenshot you have provided you are assigning Active = 1 in set 1. This is only compared to be 1 in set 3. I would expect that if you are assigning Active in set 2 as well, this would not prevent set 3 from comparing this as true, however is set 3 the set you are inquiring about?

        Are you certain you are assigning (setting) Active a value in set 2? (Did you mean comparing the value to 1?)

        You have stated that the strategy does not show trades. By this I have assumed you are inquiring about set 2, where the entry order is submitted is not evaluating as true, is this correct?

        Print the values used in the conditions of this set. On what bar are you seeing that all conditions in the set are evaluating as true?

        Save the output from the output window to a text file (Right-click -> Save As) and attach this to your next post so we may investigate the output and understand the behavior.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,406 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        98 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        8 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        160 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        9 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X