Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error when adding For loop in OnStartUp()

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

    Error when adding For loop in OnStartUp()

    I have a for loop in OnStartup:-

    Code:
    protected override void OnStartUp()
    		{
        	 
    			
    			if(Instrument.Expiry.Year > 2013 && Instrument.Expiry.Month > 9 || Instrument.Expiry.Year == 2013 && Instrument.Expiry.Month > 9)
    			{
    				List<int> fgblU13Win = new List<int> ()
    					{
    						8,18,14,41,16,17,33,34,29,61,92,29,8,30,25,16,14,23,27,10,58,19,6,11,8,16,7,43,22,33,8,56,13,30,14,58,21,28,37,28,15
    					};
    					
    				For(int i = 0; i < fgblU13Win.Count; i++)
    					{
    					mfeWinnerList.Add(fgblU13Win[g]);
    					}
    
    			}
    But im getting errors when compiling it but in not sure why, Here are the errors:-


    Strategy\PivOscDiv.cs Invalid expression term 'int' CS1525 - click for info 144 13
    Strategy\PivOscDiv.cs ; expected CS1002 - click for info 144 43
    Strategy\PivOscDiv.cs Invalid expression term ')' CS1525 - click for info 144 43
    Strategy\PivOscDiv.cs ; expected CS1002 - click for info 144 44

    #2
    GKonheiser, only thing standing out visual to me is the capitalized For when it should be for.

    Comment


      #3
      Oh that was stupid of me, thx, just didnt see it

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X