PDA

View Full Version : Zigzag



nieme11
10-12-2007 19:20, 07:20 PM
Chào,

bất cứ ai có thể nói với tôi, tại sao Stoploss (_low [shift]) don`t làm việc?
Một khi tôi tạo ra nó như một chỉ báo ... _high [shift] và low [shift] hoạt động tốt ... nhưng tại pro không ... và khi nào (Giá thầu gt; = _high [I]) không hoạt động đúng

cám ơn

Đã chèn mã/ --------------------------------------------- --------------------- /| .mq4 |/| Bản quyền © 2005-2007, Tập đoàn phần mềm MetaQuotes .. |/| http://www.metaquotes.net/|/ ----------------------------------------------- ------------------- #property copyright Bản quyền © 2007, MetaQuotes Software Corp. #property liên kết http://www.metaquotes.net/extern double Lots = 0.1; extern dual TrailingStop = 30;/- chỉ số tham số extern int ExtDepth = 12; extern int ExtDeviation = 5; extern int ExtBackstep = 3;/- bộ đệm chỉ báo kép BufferNumber91; # 93 ;; kép HighMapBufferNumber91; # 93 ;; dual LowMapBuffer # 91; # 93 ;; kép _high # 91; # 93 ;; dual _low # 91; # 93 ;; dual lasthigh; kép cuối cùng; int độ = 3;/recounting's depth bool downloadhistory = false;/ ----------------------------------------------- ------------------- /| Chức năng khởi tạo chỉ báo tùy chỉnh |/ ----------------------------------------------- ------------------- int init () IndiorBuffers (7);/- tùy chọn vẽ/SetIndexStyle (0, DRAW_SECTION);/SetIndexStyle (3, DRAW_LINE);/- bộ đệm chỉ báo ánh xạ SetIndexBuffer (0, Bộ đệm); SetIndexBuffer (1, HighMapBuffer); SetIndexBuffer (hai, LowMapBuffer); SetIndexBuffer (3, lasthigh); SetIndexBuffer (4, lastlow); SetIndexBuffer (5, _high); SetIndexBuffer (6, _low); SetIndexEmptyValue (0,0.0);/- chỉ số tên ngắn IndiorShortName (ZigZag ( ExtDepth , ExtDeviation , ExtBackstep ));/- khởi tạo xong (0);/ ----------------------------------------------- ------------------- /| |/ ----------------------------------------------- ------------------- int start () int I, count_bars = IndiorCounted (); int giới hạn, counterZ, whatlookfor; int shift, back, lasthighpos, lastlowpos; đôi val, res; kép curlow, curhigh; int cnt, ticket, complete; if (count_bars == 0* downloadhistory *)/lịch sử đã được tải xuống ArrayInitialize (Buffer, 0.0); ArrayInitialize (HighMapBuffer, 0.0); ArrayInitialize (LowMapBuffer, 0.0); if (count_bars == 0) limit = Bars-ExtDepth; downloadhistory = true; if (count_barsgt; 0) while (counterZlt; độ ilt; 100) res = Vùng đệm # 91; I # 93 ;; if (res! = 0) counterZ ; I ; I--; giới hạn = I; if (LowMapBuffer # 91; I # 93 ;! = 0) curlow = LowMapBuffer # 91; I # 93 ;; whatlookfor = 1; else curhigh = HighMapBuffer # 91; I # 93 ;; whatlookfor = -1; cho (I = giới hạn-1; igt; = 0; I--) Bộ đệm # 91; I # 93; = 0,0; LowMapBuffer # 91; I # 93; = 0,0; HighMapBuffer # 91; I # 93; = 0,0; cho (shift = giới hạn; shiftgt; = 0; shift -)val = Giảm # 91; iLowest (NULL, 0, MODE_LOW, ExtDepth, shift) # 93 ;; nếu (val == lastlow) val = 0,0; nếu không lastlow = val; if ((Low # 91; shift # 93; -val) gt; (ExtDeviation * Stage)) val = 0,0; khác cho (back = 1; backlt; = ExtBackstep; back ) res = LowMapBuffer # 91; shift back # 93 ;; if ((res!) = 0) (resgt; val)) LowMapBuffer # 91; shift back # 93; = 0.0; if (Thấp # 91; shift # 93; == val) LowMapBuffer # 91; shift # 93; = val; nếu không thì LowMapBuffer # 91, shift # 93; = 0.0;/- cao val = Cao # 91; iHighest (NULL, 0, MODE_HIGH, ExtDepth, shift) # 93 ;; nếu (val == lasthigh) val = 0,0; nếu không lasthigh = val; if ((val-HighNumber91; shift # 93;) gt; (ExtDeviation * Stage)) val = 0,0; khác cho (back = 1; backlt; = ExtBackstep; back ) res = HighMapBuffer # 91; shift back # 93 ;; if ((res!) = 0) (reslt; val)) HighMapBuffer # 91; shift back # 93; = 0.0; if (Cao # 91; shift # 93; == val) HighMapBuffer # 91; shift # 93; = val; nếu không thì HighMapBuffer # 91, shift # 93; = 0.0;/đóng cắt nếu (whatlookfor == 0) lastlow = 0; lasthigh = 0; else lastlow = curlow; lasthigh = curhigh; cho (shift = giới hạn; shiftgt; = 0; shift -) res = 0,0; chuyển đổi (whatlookfor) trường hợp 0:/tìm đỉnh hoặc bãi cỏ nếu (lastlow == 0 lasthigh == 0) nếu (HighMapBufferNumber91; shift # 93 ;! = 0) lasthigh = Giảm # 91; shift # 93 ;; lasthighpos = shift; whatlookfor = -1; Đệm # 91; shift # 93; = lasthigh; res = 1; if (LowMapBuffer # 91; shift # 93 ;! = 0) lastlow = Giảm # 91; shift # 93 ;; lastlowpos = shift; whatlookfor = 1; Đệm # 91; shift # 93; = lastlow; res = 1; chia; trường hợp 1:/tìm đỉnh nếu (LowMapBuffer # 91; shift # 93 ;! = 0.0 LowMapBuffer # 91; shift # 93; lt; lastlow HighMapBuffer # 91; shift # 93; == 0.0) Buffer # 91; lastlowpos # 93; = 0,0; lastlowpos = shift; lastlow = LowMapBuffer # 91; shift # 93 ;; Đệm # 91; shift # 93; = lastlow; res = 1; if (HighMapBuffer # 91; shift # 93 ;! = 0.0 LowMapBuffer # 91; shift # 93; == 0.0) lasthigh = HighMapBuffer # 91; shift # 93 ;; lasthighpos = shift; Đệm # 91; shift # 93; = lasthigh; whatlookfor = -1; res = 1; chia; case -1:/tìm bãi cỏ nếu (HighMapBuffer # 91; shift # 93 ;! = 0.0 HighMapBuffer # 91; shift # 93; gt; lasthigh LowMapBuffer # 91; shift # 93; == 0.0)Bộ đệm # 91; lasthighpos # 93; = 0,0; lasthighpos = shift; lasthigh = HighMapBuffer # 91; shift # 93 ;; Đệm # 91; shift # 93; = lasthigh; if (LowMapBuffer # 91; shift # 93 ;! = 0.0 HighMapBuffer # 91; shift # 93; == 0.0) lastlow = LowMapBuffer # 91; shift # 93 ;; lastlowpos = shift; Đệm # 91; shift # 93; = lastlow; whatlookfor = 1; chia; default: return;/switch (whatlookfor)/cho (shift = limitation; shiftgt; = 0; shift--) complete = OrdersTotal (); nếu (totallt; 1) _high # 91; I # 93; = lasthigh; _low # 91; I # 93; = lastlow; if (Giá thầu gt; = _high # 91; I # 93; -RRB- OrderSend (Ký hiệu (), OP_BUY, Rất nhiều, Hỏi, 3, _low # 91; I # 93;, 0, Long, 1,0, Green) ; else if (Bid lt; = _low # 91; shift # 93; -RRB- OrderSend (Ký hiệu (), OP_SELL, Rất nhiều, Giá thầu, 3,0,0, Ngắn, 1,0, Đỏ); trả về (0) ;/ ---------------------------------------------- --------------------

ttkarôr97
12-05-2021 18:16, 06:16 PM
Bất cứ ai có thể xin vui lòng cho tôi biết cách để đặt một zag zig về các chỉ số từ MT 4? Yêu nó? cảm ơn.