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

Code for 1 Trade

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

    Code for 1 Trade

    Hello.

    I have a strategy , that is based on Cross's and DBBS . The thing i want but i cant seem to be able to do it is put on the Strategy, that it can only do 1 Trade PER cross.

    Exemple:

    - Emas Cross + Zone of DBBS to sell -> Open sell.
    (this i made it work)

    the problem is after the Target is achived, he keeps make more trades... I want that the strategy wait for the next Cross, to make a New trade. All i did was in wizzard, so if possible, could some 1 tell me exactly what Code line i need to add and wher?

    Thank you guys

    #2
    Hello PauloP,

    Thank you for writing in.

    What I would suggest is the use of the built-in user defined variables. With these, you can keep track of when conditions occur and have events only occur if this variable is a specific value.

    I have provided a video demonstrating the use of user defined variables within the Strategy Wizard: http://screencast.com/t/x2LsrBGhI6

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Thanks alot ZacharyG ! Excelent help

      Comment


        #4
        Originally posted by NinjaTrader_ZacharyG View Post
        Hello PauloP,

        Thank you for writing in.

        What I would suggest is the use of the built-in user defined variables. With these, you can keep track of when conditions occur and have events only occur if this variable is a specific value.

        I have provided a video demonstrating the use of user defined variables within the Strategy Wizard: http://screencast.com/t/x2LsrBGhI6

        Please, let us know if we may be of further assistance.

        I just have 1 Doubt.... around 0.58, you have at the 1 rectangle, Variable0 == 1 , when i go try the same, i dont have a option "1" anywher. I'm doing something Wrong?

        Comment


          #5
          Hello PauloP,

          To set that condition up, follow the instructions below:
          1. In the Condition Builder, select User variables -> Variable0 in the first column
          2. Ensure that == is selected for the center comparison column
          3. Select Misc -> Numeric value


          Please, let us know if we may be of further assistance.
          Zachary G.NinjaTrader Customer Service

          Comment


            #6
            1 more time! Thanks alot

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by selu72, Today, 02:01 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Started by WHICKED, Today, 02:02 PM
            2 responses
            11 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by f.saeidi, Today, 12:14 PM
            8 responses
            21 views
            0 likes
            Last Post f.saeidi  
            Started by Mikey_, 03-23-2024, 05:59 PM
            3 responses
            51 views
            0 likes
            Last Post Sam2515
            by Sam2515
             
            Started by Russ Moreland, Today, 12:54 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Erick  
            Working...
            X