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, 10:52 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by JanessaWind, Today, 09:54 PM
      0 responses
      2 views
      0 likes
      Last Post JanessaWind  
      Started by grasshopperguru79, Today, 09:09 PM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_EricB  
      Started by Barry Milan, Today, 07:52 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_EricB  
      Started by BarzTrading, 11-07-2018, 09:50 PM
      4 responses
      388 views
      0 likes
      Last Post quantismo  
      Started by justanewbe, Today, 06:31 PM
      8 responses
      37 views
      0 likes
      Last Post justanewbe  
      Working...
      X