Xin chào tất cả mọi người, tôi gặp sự cố với cảnh báo bằng âm thanh cho Bóp bắp thịt. Tôi tìm thấy một cảnh báo cho BBS squeeze indior, cảnh báo hoạt động # 8230, không phải cách tôi thích nó. Tín hiệu thực tế là khi dấu chấm chuyển sang màu xanh ở cuối thanh và dấu chấm trước đó màu đỏ. Hiện tại, cảnh báo phát ra ở mọi chấm đỏ và thường nhiều lần vì dấu chấm hiện tại có thể thay đổi từ màu đỏ sang màu xanh lục. Vì vậy, ngay cả khi tôi có thể làm cho nó cảnh giác đi bằng cách đóng nó vẫn sẽ cảnh báo ở mọi chấm đỏ, khi tín hiệu cho tôi thực sự là một dấu chấm màu xanh lá cây trước một dấu chấm màu đỏ. Bằng cách nào đó tôi cần nó để cảnh báo khi một chấm đóng màu xanh lá cây và chấm trước đó là màu đỏ. Điều này có thể không? Nếu ai đó biết làm thế nào điều này có thể có thể được thực hiện tôi rất nhiều sẽ đánh giá cao sự giúp đỡ nào. Cảm ơn trước.
Đã chèn Mã số # 91, trái # 93;/ -------------------------------------- ---------------------------- /| bbsqueeze.mq4 |/| Bản quyền © 2005, Nick Bilak, beluck # 91; AT # 93; gmail.com |/| tăng cường một chút bởi CJ Rivas, carlos # 91; AT # 93; vealo.com |/ ----------------------------------------------- ------------------- #property copyright Bản quyền © 2005, Nick Bilak #property indior_separate_window #property indior_buffers 6 #property indior_color1 Màu xanh #property indior_color2 Màu đỏ #property indior_color3 DarkBlue #property indior_color4 Maroon #property indior_color5 Red #property indior_color6 Lime/---- tham số đầu vào extern int bolPrd = 20; extern double bolDev = 2.0; extern int keltPrd = 20; extern double keltFactor = 1,5; extern int momPrd = 12; extern bool AlertSqueezeStart = false; extern bool AlertSqueezeEnd = false;/---- bộ đệm tăng gấp đôi upB # 91; # 93 ;; double upB2 # 91; # 93 ;; double loB # 91; # 93 ;; double loB2 # 91; # 93 ;; double upK # 91; # 93 ;; double loK # 91; # 93 ;; int i, j, trượt = 3; breakpoint đôi = 0,0; double ema = 0,0; int peakf = 0; int peaks = 0; int valleyf = 0; int valleys = 0, giới hạn = 0; đôi ccis # 91, 61 # 93 ;, ccif # 91; 61 # 93 ;; delta kép = 0; double ugol = 0;/ ----------------------------------------------- ------------------- /| Chức năng khởi tạo indior tùy chỉnh |/ ----------------------------------------------- ------------------- int init () {//---- nội dung SetIndexStyle (0, DRAW_HISTOGRAM, EMPTY, 3); SetIndexBuffer (0, upB); SetIndexEmptyValue (0, EMPTY_VALUE); SetIndexStyle (1, DRAW_HISTOGRAM, EMPTY, 3); SetIndexBuffer (1, loB); SetIndexEmptyValue (1, EMPTY_VALUE); SetIndexStyle (4, DRAW_ARROW, EMPTY, 2); SetIndexBuffer (4, upK); SetIndexEmptyValue (4, EMPTY_VALUE); SetIndexArrow (4,159); SetIndexStyle (5, DRAW_ARROW, EMPTY, 2); SetIndexBuffer (5, loK); SetIndexEmptyValue (5, EMPTY_VALUE); SetIndexArrow (5,159); SetIndexStyle (2, DRAW_HISTOGRAM, EMPTY, 3); SetIndexEmptyValue (2, EMPTY_VALUE); SetIndexBuffer (2, upB2); SetIndexStyle (3, DRAW_HISTOGRAM, EMPTY, 3);SetIndexEmptyValue (3, EMPTY_VALUE); SetIndexBuffer (3, loB2);/---- return (0); }/ ---------------------------------------------- -------------------- /| Custor indior deinitialization chức năng |/ ----------------------------------------------- ------------------- int deinit () {//----/---- return (0); }/ ---------------------------------------------- -------------------- /| Chức năng lặp đi lặp lại tùy chỉnh |/ ----------------------------------------------- ------------------- int start () {int counting_bars = IndiorCounted (); int thay đổi, giới hạn; double diff, d, dPrev, std, bbs; if (count_barslt; 0) return (-1); if (count_barsgt; 0) counting_bars--; limit = Bars-31; if (count_barsgt; = 31) limit = Bars-count_bars-1; cho (shift = limit; shiftgt; = 0; shift--) {//d = iMomentum (NULL, 0, momPrd, PRICE_CLOSE, shift); d = LinearRegressionValue (bolPrd, shift); dPrev = LinearRegressionValue (bolPrd, shift 1); if (dgt; 0) {if ((dPrevgt; 0) (dPrev gt; d)) {upB2 # 91; shift # 93; = d; upB # 91; shift # 93; = 0; } else {upB # 91; shift # 93; = d; upB2 # 91; shift # 93; = 0; }/upB # 91; shift # 93; = 0; loB # 91; shift # 93; = 0; loB2 # 91; shift # 93; = 0; } else {if ((dPrevlt; 0) (dPrev lt; d)) {loB2 # 91; shift # 93; = d; loB # 91; shift # 93; = 0; } else {loB # 91; shift # 93; = d; loB2 # 91; shift số 93; = 0; } upB # 91; shift # 93; = 0; upB2 # 91; shift # 93; = 0;/loB # 91; shift # 93; = d; } diff = iATR (NULL, 0, keltPrd, shift) * keltFactor; std = iStdDev (NULL, 0, bolPrd, MODE_SMA, 0, PRICE_CLOSE, thay đổi); bbs = bolDev * stddiff; if (bbslt; 1) {upK # 91; shift # 93; = 0; loK # 91; shift # 93; = EMPTY_VALUE; } else {loK # 91; shift # 93; = 0; upK # 91; shift # 93; = EMPTY_VALUE; } đôi diffprev, stdprev, bbsprev; diffprev = iATR (NULL, 0, keltPrd, 1) * keltFactor; stdprev = iStdDev (NULL, 0, bolPrd, MODE_SMA, 0, PRICE_CLOSE, 1); bbsprev = bolDev * stdprevdiffprev; } {if (bbsprevgt; = 1 bbslt; 1 AlertSqueezeStart == true) nếu (NewBar ()) Alert (Symbol (),, Period (), BB Bóp Bắt đầu); } {if (bbsprevlt; 1 bbsgt; = 1 AlertSqueezeEnd == true) nếu (NewBar ()) Alert (Ký hiệu (),, Period (), BB Squeeze Ended); } return (0); }/ ---------------------------------------------- -------------------- double LinearRegressionValue (int Len, int shift) {double SumBars = 0; đôi SumSqrBars = 0; double SumY = 0; đôi Sum1 = 0; đôi Sum2 = 0; double Slope = 0; SumBars = Len * (Len-1) * 0,5; SumSqrBars = (Len - 1) * Len * (2 * Len - 1)6; cho (int x = 0; xlt; = Len-1; x ) {gấp đôi HH = Thấp # 91; x shift # 93 ;; đôi LL = Cao # 91; x shift # 93 ;; cho (int y = x; ylt; = (x Len) -1; y ) {HH = MathMax (HH,Cao # 91; y shift # 93;); LL = MathMin (LL, Thấp # 91; y shift # 93;); } Sum1 = x * (Đóng # 91; x shift # 93; - ((HH LL)2 iMA (NULL, 0, Len, 0, MODE_EMA, PRICE_CLOSE, x shift))2); SumY = (Đóng # 91; x shift # 93; - ((HH LL)2 iMA (NULL, 0, Len, 0, MODE_EMA, PRICE_CLOSE, x shift))2); } Sum2 = SumBars * SumY; đôi Num1 = Len * Sum1 - Sum2; đôi Num2 = SumBars * SumBars-Len * SumSqrBars; nếu (Num2! = 0.0) {Độ dốc = Num1Num2; } else {Slope = 0; } double Intercept = (SumY - Slope * SumBars)Len; double LinearRegValue = Intercept Slope * (Len - 1); return (LinearRegValue); } bool NewBar () {static datetime dt = 0; if (dt! = Thời gian # 91; 0 # 93;) {dt = Thời gian # 91; 0 # 93 ;; Ngủ (100);/đợi đánh dấu (đúng); } return (false); } return (0); # 91;left # 93;