ใครสามารถช่วยฉัน wรหัสนี้ ไม่ได้วาดเส้นแนวโน้มอย่างถูกต้อง หรือถ้าใครมีวิธีที่ดีกว่าโปรดแจ้งให้เราทราบ
ใส่รหัส # property indior_chart_window # property indior_buffers 2 extern int varExtDepth = 12; int int varExtDeviation = 5; extern int varExtBackstep = 3; เพดานคู่ # 91; # 93 ;; ชั้นสอง # 91; # 93 ;; int init () {//ภายในบ้าน IndiorBuffers (2); IndiorDigits (ตัวเลข);/---- รูปวาดการตั้งค่า/---- indior บัฟเฟอร์การแมป SetIndexBuffer (0 เพดาน); SetIndexBuffer (1 ชั้น); SetIndexLabel (0, Upper band); SetIndexLabel (1 แถบล่าง); SetIndexEmptyValue (0,0.0); SetIndexEmptyValue (1,0.0); ArraySetAsSeries (เพดานจริง); ArraySetAsSeries (ชั้นจริง);/---- return (0); } int deinit () {//---- ObjectDelete (เพดาน); ObjectDelete (ชั้น);/---- return (0); } int เริ่มต้น () {//int counted_bars = IndiorCounted ();/---- int เปลี่ยน; bool varNewBar = funcIsNewBar (ระยะเวลา ()); ถ้า (varNewBar) {ObjectDelete (เพดาน); ObjectDelete (ชั้น); procDrawTrends (); for (shift = บาร์ -1, shiftgt; = 0; shift--) (เพดาน # 91; shift # 93; = ObjectGetValueByShift (เพดาน shift); ชั้น # 91; เปลี่ยน # 93; = ObjectGetValueByShift (ชั้นกะ); }} ผลตอบแทน (0); }/ ---------------------------------------------- -------------------- void procDrawTrends () {int ZigZagHighCount = 0, ZigZagLowCount = 0, ZigZagCount = 0; int ZigZagShift = 0; ดับเบิ้ล ZZHigh # 91; 2 # 93; ZZLow # 91; 2 # 93 ;; datetime ZZtime # 91; 2 # 93; ZZLTime # 91; 2 # 93 ;; ขณะที่ (ZigZagHighCount lt; 3 ZigZagLowCount lt; 3) {double ZigZag = iCustom (NULL, 0, ZigZag, varExtDepth, varExtDeviation, varExtBackstep, 0, ZigZagShift); ถ้า (ZigZag == สูง # 91; ZigZagShift # 93; | ZigZag == ต่ำ # 91; ZigZagShift # 93;) ZigZagCount == 0) {ZigZagCount ; ZigZagShift ;} else {if (ZigZag == สูง # 91; ZigZagShift # 93;) {ZZHigh # 91; ZigZagHighCount # 93; ZigZag; ZZHTime # 91; ZigZagHighCount # 93; = iTime (NULL, 0, ZigZagShift); ZigZagHighCount ; ZigZagCount ; }/ทำ reverse for short if (ZigZag == ต่ำ # 91; ZigZagShift # 93;) {ZZLow # 91; ZigZagLowCount # 93; = ZigZag; ZZLTime # 91; ZigZagHighCount # 93; = iTime (NULL, 0, ZigZagShift); ZigZagLowCount ; ZigZagCount ; }} ZigZagShift ; } ObjectCreate (เพดาน, OBJ_TREND, 0, ZZHTime # 91; 1 # 93; ZZHigh # 91; 1 # 93; ZZHTime # 91; 0 # 93; ZZHigh # 91; 0 # 93;); ObjectCreate (ชั้น OBJ_TREND, 0, ZZLTime # 91; 1 # 93;, ZZLow # 91; 1 # 93;, ZZLTime # 91; 0 # 93;, ZZLow # 91; 0 # 93;); ObjectSet (เพดาน OBJPROP_STYLE, STYLE_SOLID); ObjectSet (ชั้น OBJPROP_STYLE, STYLE_SOLID); ObjectSet (เพดาน OBJPROP_WIDTH 2); ObjectSet (ชั้น OBJPROP_WIDTH 2); ObjectSet (เพดาน OBJPROP_COLOR, น้ำเงิน); ObjectSet (ชั้น OBJPROP_COLOR, สีแดง); ObjectSet (เพดาน OBJPROP_RAY จริง); ObjectSet (ชั้น OBJPROP_RAY จริง);/สตริง varMessage, n = \ n; varMessage = StringConenate (ZigZagCount:, ZigZagCount, n, ZigZagHighCount:, ZigZagHighCount, n, ZigZagLowCount:, ZigglagCount, n, ZZHTime # 91; 0 # 93 ;:, funcSetDateTime (ZZHTime # 91; 0 # 93;), n, ZZHigh # 91; 0 # 93 ;: ZZHigh # 91; 0 # 93;, n, ZZHTime # 91; 1 # 93 ;:, funcSetDateTime (ZZHTime # 91; 1 # 93;), n, ZZHigh # 91; 1 # 93 :, ZZHigh # 91; 1 # 93 ;, n, ZZLTime # 91; 0 # 93 ;:, funcSetDateTime (ZZLTime # 91; 0 # 93;), n, ZZLow # 91; 0 # 93 :, ZZLow # 91; 0 # 93 ;, n, ZZLTime # 91; 1 # 93 ;:, funcSetDateTime (ZZLTime # 91; 1 # 93;), n, ZZLow # 91; 1 # 93 ;:, ZZLow # 91; 1 # 93;); แสดงความคิดเห็น (varMessage); ผลตอบแทน (0); } สตริง funcSetDateTime (datetime varTime) {datetime curtime = varTime; int วัน = TimeDay (curtime); int themonth = TimeMonth (curtime); int theyear = TimeYear (ระยะเวลาในช่วงเทศกาล); int thehour = TimeHour (curtime); int theminute = TimeMinute (curtime); สตริงวันที่ = StringConenate (themonth,, theday,, theyear,, thehour,:, theminute); กลับ (thedate); }/ ---------------------- สนับสนุน funcion (s) ------------------- ----- bool funcIsNewBar (int timeFrame) {bool res = เท็จ;/อาร์เรย์มีเวลาเปิดของแถบปัจจุบัน (ศูนย์)/เป็นเวลา 7 (เจ็ด) timeframes แบบคงที่ _sTime # 91; 7 # 93 ;; int i = 6;/หมายเหตุ: ฉันด้านล่างจะเป็น 6 หรือกรอบเวลาจะเป็นวัน สวิตช์ (timeFrame) {กรณีที่ 1: i = 0; ทำลาย; กรณีที่ 5: i = 2; ทำลาย; กรณี 15: i = 3; ทำลาย; กรณี 30: i = 4; ทำลาย; กรณี 60: i = 5; ทำลาย; กรณี 240: แบ่ง; กรณี 1440: แบ่ง; ค่าเริ่มต้น: timeFrame = 1440; }/_ _ _ _ _ _ _ ############################################################################################################# 93; = iTime (Symbol (), timeFrame, 0); ความละเอียด = true; }/---- return (res); }