Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnStartUp Problem

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

    OnStartUp Problem

    I have declared an int,

    Code:
    public int dp;
    in OnStartUp I initalize it:-

    Code:
    protected override void OnStartUp()
    		{
       			// finds the number of decinmal places in TickSize of product
    			double d = TickSize - (int)TickSize;
    			string dstr = d.ToString();
    			int dp = 0;
    			if (dstr.IndexOf(".") > 0) 
    				dp = dstr.Length - 2;
    			else 
    				dp = 0;
    		}

    this code sets dp to the number of decimal places of the TickSize. For FGBL for example TickSize is 0.01 and the value for dp is set to 2.

    The problem I am having is some where after OnStartUp the value for dp is being changed to 0. I have stepped tho the code and after it is set at a value of 2 and before the first call to OnBarUpdate it is being changed to 0 ?? Im very confused , any one know why?


    *********Found the problem**********
    Last edited by GKonheiser; 06-30-2015, 08:15 AM. Reason: FOUND THE PROBLEM

    #2
    Hello GKonheiser,

    Thank you for the update. I am glad to hear you were able to resolve the issue.

    For other users who may be experiencing the same issue, please note that
    Code:
    int dp = 0;
    was called, re-initializing the variable. A solution is simply to use
    Code:
    dp = 0;
    Please let us know if we may be of assistance.
    Michael M.NinjaTrader Quality Assurance

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    637 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    571 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X