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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      52 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      142 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      160 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      96 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      276 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X