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 TheWhiteDragon, 01-21-2019, 12:44 PM
      4 responses
      541 views
      0 likes
      Last Post PaulMohn  
      Started by GLFX005, Today, 03:23 AM
      0 responses
      3 views
      0 likes
      Last Post GLFX005
      by GLFX005
       
      Started by XXtrader, Yesterday, 11:30 PM
      2 responses
      11 views
      0 likes
      Last Post XXtrader  
      Started by Waxavi, Today, 02:10 AM
      0 responses
      7 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      14 views
      0 likes
      Last Post TradeForge  
      Working...
      X