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

Delete DB and Create Sim accounts programmatically

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

    Delete DB and Create Sim accounts programmatically

    Hello,

    Is there a way to do this automatically. It's pretty tedious to do it manually. If you have made many trades resetting the account is not an option as it takes forever so it's best to just delete de DB and create new Sim accounts. So is there a way one could make this process automatically for instance:

    // OnBarUpdate()
    if (CurrentBars[0] == 0)
    {
    // delete DB;
    // Create Sim2,3,4...
    }

    #2
    Hello roblogic,

    There is not a way to interact with the database or do resets from scripting. You would need to manually reset the account/create the account if you need to modify it.

    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Try AutoHotkey.

      Comment


        #4
        Thanks. May I request a future update including this feature, or at least a much faster way to reset SIM accounts?

        Comment


          #5
          Hello roblogic,

          I put in a feature request for this item.

          Please let me know if I may be of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            A relatively straightforward way to quickly reset the db:
            1. Shutdown NT
            2. Rename/delete the current db file
            3. Restart NT -- this will automatically create a new db file
            4. Update the [now new] db with whatever changes you want so it is how you want it when "reset" -- this becomes your "reset to template" db
            5. Copy the updated db file to wherever you wish [preferably not in the NT folder as a remove/reinstall of NT may lose it]
            6. When required, with NT not running, rename/delete the old db file
            7. Copy the saved "template" file to be the current db
            8. Restart NT -- the copied template file is now the current db and everything will be as you set it in that file
            Hope that helps.

            Thanks.
            Multi-Dimensional Managed Trading
            jeronymite
            NinjaTrader Ecosystem Vendor - Mizpah Software

            Comment


              #7
              Originally posted by jeronymite View Post
              A relatively straightforward way to quickly reset the db:
              1. Shutdown NT
              2. Rename/delete the current db file
              3. Restart NT -- this will automatically create a new db file
              4. Update the [now new] db with whatever changes you want so it is how you want it when "reset" -- this becomes your "reset to template" db
              5. Copy the updated db file to wherever you wish [preferably not in the NT folder as a remove/reinstall of NT may lose it]
              6. When required, with NT not running, rename/delete the old db file
              7. Copy the saved "template" file to be the current db
              8. Restart NT -- the copied template file is now the current db and everything will be as you set it in that file
              Hope that helps.

              Thanks.
              Thanks. This is the workaround I do. I just delete de DB. Then I have to recreate all SIM accounts manually which is a bit of a pain though...

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by YongJane, Today, 01:00 AM
              0 responses
              2 views
              0 likes
              Last Post YongJane  
              Started by MSerag, 05-06-2024, 11:52 PM
              4 responses
              25 views
              0 likes
              Last Post MSerag
              by MSerag
               
              Started by TraderCro, Today, 12:13 AM
              0 responses
              2 views
              0 likes
              Last Post TraderCro  
              Started by Skifree, Yesterday, 11:47 PM
              0 responses
              7 views
              0 likes
              Last Post Skifree
              by Skifree
               
              Started by Skifree, Yesterday, 11:41 PM
              0 responses
              6 views
              0 likes
              Last Post Skifree
              by Skifree
               
              Working...
              X