Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            77 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            40 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            63 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            63 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            53 views
            0 likes
            Last Post CarlTrading  
            Working...
            X