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

Different starting schemes of a trading system

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

    #16
    Hello pmmkm,

    Thank you for your reply.

    I'd like to clarify further on this second part. The strategy you provided chooses whether to go long or short based on the user inputting "L" for long or "S" for short. Is this how it functions when you use it? So in this case is it:

    SHORT 20.......40.........0.........0. ........0........(does the strategy get restarted here? How did it go from 40 to flat? If you use the version with the State check here, it should restart at 20)..."120".

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #17
      1. Yes, the strategy is based on the user input L or S for Long or Short.

      2. From 40 to flat is a stopp in between either Loss or a profit pre defined money stopp Once the position is stopped, it starts after a 3 day pause again from 20

      Comment


        #18
        Hello pmmkm,

        Thank you for your reply.

        If the strategy gets stopped out, it should start back over with 20 even if the strategy loses connection. If it did lose connection, you should be able to use the version with no state check to restart it at 20, as it should know it would have been stopped out previously and currently be in a flat state.

        Is this not the case? Can you provide an example of this not happening when the strategy was previously going in the same direction?

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #19
          No, it don´t works

          for example:

          The system is stopped out AND the direction changes. I use the state check version for starting the strategy again in the other direction with 20. Ok so far everything fine
          two days for example later, the system has 60 contracts and I lose connection. Restart with state check it starts with 20 whats wrong. Restart with no state check, then the system calculates all historical trades and starts where the historical position is and it is everywhere else not at the 60 where it should be........ could be by coinsidence but thats not what we intend.

          It is also useless for backtesting. The system trades automatically with manually changing the trade direction, that must be somehow possible to consider? ....or not.
          .........

          What I want is that I push a button or add a date and the system starts on the next day from zero (with "20") and the push of the button has to be recognized and remembered somehow.

          That a "direction changing date" is added for example,.....any ideas?

          Comment


            #20
            It is obvious that the START of the strategy can be somehow added ...with a date

            START_Long_Date
            START_Short_Date

            Comment


              #21
              Hello pmmkm,

              Thank you for your replies.

              Strategy instances are not able to communicate with each other, so if you stop a strategy and restart it, it doesn't know anything the previous instance of the same strategy actually did. To accomplish something like you suggest, you will need to write these values to a text file and the read the values from the other strategy.

              This would not be possible to accomplish with the Strategy Wizard and I would consider this fairly advanced scripting.

              Below is a link to a reference sample on writing to a file.
              http://www.ninjatrader.com/support/f...ead.php?t=3475

              And an reference sample on reading from a file.
              http://www.ninjatrader.com/support/f...ead.php?t=3476

              Your other option here would be to incorporate the long/short shift into the strategy itself so you don't have to restart it when your direction needs to change. This way when it looks back at your recent orders it better knows where to restart properly after a connection loss, since they all came from the same instance's calculations.

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



              Kate W.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Jon17, Today, 04:33 PM
              0 responses
              1 view
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              6 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Started by alifarahani, Today, 09:40 AM
              6 responses
              41 views
              0 likes
              Last Post alifarahani  
              Started by Waxavi, Today, 02:10 AM
              1 response
              21 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Working...
              X