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 Radano, 06-10-2021, 01:40 AM
            19 responses
            605 views
            0 likes
            Last Post Radano
            by Radano
             
            Started by KenneGaray, Today, 03:48 AM
            0 responses
            4 views
            0 likes
            Last Post KenneGaray  
            Started by thanajo, 05-04-2021, 02:11 AM
            4 responses
            470 views
            0 likes
            Last Post tradingnasdaqprueba  
            Started by aa731, Today, 02:54 AM
            0 responses
            5 views
            0 likes
            Last Post aa731
            by aa731
             
            Started by Christopher_R, Today, 12:29 AM
            0 responses
            11 views
            0 likes
            Last Post Christopher_R  
            Working...
            X