Announcement

Collapse
No announcement yet.

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

    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 NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X