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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X