限制一根K线只开仓一次
- bool Fun_New_Bar()
- {
- static datetime New_Time = 0;
- bool New_Bar = false;
- if (New_Time!= Time[0])
- {
- New_Time = Time[0];
- New_Bar = true;
- }
- return(New_Bar);
- }
- bool isNewBar()
- { static datetime TimeBar=0;
- bool flag=false;
- if(TimeBar!=Time[0])
- {
- TimeBar=Time[0];
- flag=true;
- }
- return (flag);
- }
|