Storing value in a variable

 

Friends,

The value stored in variable TL3 is becoming zero after finishing the count no 37 using FOR statement. How to store the value in TL3 got from FOR statement even after count is over. In my EA FOR statement stops executing after BeginTime 8:00 am. The value in TL3 is lost after 8 am How to save the value in TL3 after 8 am


extern int barcount = 37;
int start() {

   string ls_5;
 color l_color_29 = Aqua;
    int l_ind_counted_0 = IndicatorCounted();
   int l_datetime_4 = TimeCurrent();
   double atrxcoef;
    
   for (int l_count_8 = 0; l_count_8 < gi_112; l_count_8++) {
      DrawObjects(l_datetime_4, "FXM" + l_count_8, BeginTime, EndTime);
      for (l_datetime_4 = DecreaseDateTradeDay(l_datetime_4); TimeDayOfWeek(l_datetime_4) > 5; l_datetime_4 = DecreaseDateTradeDay(l_datetime_4)) {
      }
    }
   if (TimeToStr(Time[0], TIME_MINUTES) == BeginTime) {
  // if (TimeToStr(Time[0], TIME_MINUTES) <= EndTime) {

if(Close[0]>TL3()&& (CurTime()- Time[0])>= 360){
 return(1);
 }
return (0);
}

double TL3() {
double bar1,bar2,bar3,L3,H3;
double TL3;
      for ( int k = barcount; k >=0; k--){ //    for ( int k = 0; k < barcount; k++){  
   



    L3= High[k+2];//+5*poin);
   TL3 = High[k];
  }
  }
  }
  }
  } 
} //stop of FOR stmt
return (TL3);
}
 
Get your code to compile first by fixing your crazy braces . . . . { { { { { } } }
 
RaptorUK:
Get your code to compile first by fixing your crazy braces . . . . { { { { { } } }

And don't use decompiled one !!!

 for (int l_count_8 = 0; l_count_8 < gi_112; l_count_8++) {
 
It seems if I use static variables value can be stored in memory. So please give me some sample code using static variables used as function
Reason: