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 algospoke, Yesterday, 06:40 PM
      2 responses
      23 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      45 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      22 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      181 views
      0 likes
      Last Post jeronymite  
      Working...
      X