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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X