Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

add-on sharing

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

    add-on sharing

    I've used an add-on (below) with a static value.

    Code:
    	public class ShareData : NinjaTrader.NinjaScript.AddOnBase
    	{
    		protected override void OnStateChange()
    		{
    			if (State == State.SetDefaults)
    			{
    				Description	= @"sharing add-on";
    				Name		= "SharingAddOn";
    			}
    			else if (State == State.Configure)
    			{
    			}
    		}
    	}
    
    	public static class SharedData 
    	{
    		public static double value;
    	}
    I have a chart that sets the value and a chart that gets the value. However periodically the value gets reset to zero possibly by NT.

    Any advise (NT8).

    #2
    Hello,

    Thank you for the question.

    I would be unsure based on what is provided what may be happening. Do you have a complete sample that includes the indicator or strategy and a specific set of steps that reproduces this?

    I could run the scripts and see if I notice what may be happening, based solely on what is provided I would guess that in one of the other scripts, it is resetting the variable at some point in the scripts life cycle.

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

    Comment


      #3
      compiling one script can reset others e.g. add-ons but not always. this is the reason why the value was getting reset.

      so after editing/compiling the "get" chart script, need to reload the "set" chart script first then reload the "get" chart script (or simply restart NT).

      PS. really like NT8
      Last edited by futurenets; 03-17-2016, 11:52 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ebaydan777, Today, 02:41 PM
      0 responses
      8 views
      0 likes
      Last Post ebaydan777  
      Started by aligator, Today, 02:28 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by daniel_weber8, Today, 01:21 PM
      1 response
      21 views
      0 likes
      Last Post NinjaTrader_ChristopherS  
      Started by jungsoohuh, Today, 12:07 PM
      1 response
      28 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by SharonSS, Today, 11:54 AM
      2 responses
      22 views
      0 likes
      Last Post SharonSS  
      Working...
      X