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

How to update input parameter?

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

    How to update input parameter?

    Hello,

    I want to make a money management system (for example: if I had a winning trade, the script will add the profit to the total account value and risk relative to that).
    In order to do that, I need help in changing the "remembered" value of an input parameter (for example -> account value) by the script, and not by the user.

    In other words:
    -currently, I have an input parameter named: Account value which is by default or by a user defined as 10,000.
    -After a winning trade of $1000, I want the value of the input parameter to change to 11,000.
    -The GOAL is to make a parameter that holds a value even if I disable/enable the strategy and even close and re-open the ninjatrader.

    -Currently I can see that if I change manually the input parameter it is being remembered even if I disable/enable the strategy and even close and re-open the ninjatrader.
    I want to create the ability that it automatically updates and being saved...

    Thanks in advance!!!
    Last edited by zoharcho; 06-08-2021, 08:36 AM.

    #2
    Hi zoharcho, thanks for your post.

    The script will need to write the data to a .txt file to save it between instances. We have an example here demonstrating file IO from an indicator:

    https://ninjatrader.com/support/help..._propertie.htm

    The final value that needs to be saved can be written in OnStateChanged when State = State.Terminated.

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Great!!! will check it out - I thought I will probably need to write it to a txt file, thank you for the speedy response!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by inanazsocial, Today, 01:15 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      6 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      1 view
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      22 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Working...
      X