|
Post by thanagon on Aug 5, 2016 9:50:19 GMT 7
อยากให้ EA นับแท่ง หลังจาก Order สุดท้าย Close แล้วครับ เช่น อยากจะนับไปอีก 50 แท่ง หลังจากปิด Order ค่อยจะเปิด Order ใหม่
แน่ะนำหน่อยครับเขียนไง
|
|
|
Post by Xa Em on Aug 31, 2016 0:27:22 GMT 7
void TimeBasedSL(int TimeBasedSLperiod,int mode) { if (mode>4 || mode<=0) { Print("ERROR - mode must be 1,2,3 or 4 ..."); return; }//simple errorchecking double TimeBasedSL=0.0; string modes="unknown"; if (mode==1) {modes="days"; TimeBasedSL = TimeBasedSLperiod * 86400;}//days if (mode==2) {modes="hours"; TimeBasedSL = TimeBasedSLperiod * 3600;}//hours if (mode==3) {modes="minutes"; TimeBasedSL = TimeBasedSLperiod * 60;}//minutes if (mode==4) {modes="bars"; TimeBasedSL = TimeBasedSLperiod * Period() * 60;}//bars if ((TimeCurrent() - OrderOpenTime()) >= TimeBasedSL) { .......................................... .......................................... } } ลองเอาไปโมเอาครับ
|
|