指定

// Khai báo các tham số đầu vào
input int rsiPeriod = 14; // Chu kỳ RSI
đầu vào mua gấp đôiLevel = 30,0; // Ngưỡng quá bán RSI để mua
đầu vào bán gấp đôiLevel = 70,0; // Ngưỡng quá mua RSI để bán
đầu vào int movingAveragePeriod = 50; // Chu kỳ trung bình để theo dõi tài khoản
đầu vào rủi ro képPerTrade = 1,0; // Tỷ lệ sai sót của mỗi lệnh (% tài khoản)
input int keyLevelPeriod = 100; // Chu kỳ tìm kiếm key level
đầu vào int TrendLinePeriod = 100; // Chu kỳ tìm đường xu hướng

// Toàn bộ biến cục bộ để theo dõi hiệu suất
double totalProfit = 0;
int totalTrades = 0;
int winningTrades = 0;
int loseTrades = 0;

// Hàm khởi tạo EA
int OnInit() {
    // Khởi tạo các biến hoặc chỉ báo cần thiết
    trả về(INIT_SUCCEEDED);
}

// Hàm chạy mỗi khi có giá mới
void OnTick() {
    // Lấy hiện tại RSI giá trị
    giá trị rsiValue = iRSI(Biểu tượng(), 0, rsiPeriod, GIÁ_ĐÓNG, 0);

    // Lấy động trung giá trị để theo dõi tài khoản
    double movingAverage = iMA(Biểu tượng(), 0, movingAveragePeriod, 0, MODE_SMA, GIÁ_ĐÓNG, 0);

    // Tìm Key Level ( Hỗ trợ/Kháng cự)
    keyLevel kép = FindKeyLevel();

    // Tìm Đường Xu Hướng (Trendline)
    double trendLine = FindTrendLine();

    // Điều kiện Mua
    nếu (rsiValue < buyLevel && Close[0] > movingAverage && Close[0] > keyLevel && trendLine > 0) {
        lotSize đôi = CalculateLotSize();
        if (OrderSend(Symbol(), OP_BUY, lotSize, Ask, 3, 0, 0, "Mua từ EA", 0, 0, Green) > 0) {
            Alert("Lệnh Mua Được Đặt: RSI dưới ", buyLevel," và giá trên MA ", movingAveragePeriod);
            Cập nhật hiệu suất();
        }
    }

    // Điều kiện Bán
    nếu (rsiValue > sellLevel && Đóng[0] < movingAverage && Đóng[0] < keyLevel && trendLine < 0) {
        lotSize đôi = CalculateLotSize();
        if (OrderSend(Symbol(), OP_SELL, lotSize, Bid, 3, 0, 0, "Bán từ EA", 0, 0, Red) > 0) {
            Alert("Lệnh Bán Được Đặt: RSI trên ", sellLevel," và giá dưới MA ", movingAveragePeriod);
            Cập nhật hiệu suất();
        }
    }
}

// Hàm khi EA bị đóng
void OnDeinit(const int lý do) {
    // Dọn dẹp khi EA bị tắt
    Print("Tổng lợi nhuận: ", TotalProfit);
    Print("Tổng số giao dịch: ", TotalTrades);
    Print("Số giao dịch thắng: ", winTrades);
    Print("Số giao dịch thua: ", lossTrades);
    nếu (tổng số giao dịch > 0) {
        Print("Tỷ lệ thắng: ", (double)Số giao dịch thắng / tổng số giao dịch * 100, "%");
    }
}

// Hàm tính toán dựa trên lệnh kích thước trên mỗi lệnh đầy rủi ro
đôi CalculateLotSize() {
    double riskAmount = Số dư tài khoản() * (riskPerTrade / 100);
    gấp đôi kích thước lô = số tiền rủi ro / (100 * Điểm); // Giả sử khả năng cắt là 100 pip
    trả về NormalizeDouble(lotSize, 2);
}

// Hàm cập nhật giao dịch hiệu quả
void Cập nhật hiệu suất() {
    đối với (int i = OrdersHistoryTotal() - 1; i >= 0; i--) {
        nếu (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
            nếu (OrderSymbol() == Symbol() && OrderType() <= OP_SELL) {
                lợi nhuận gấp đôi = OrderProfit();
                tổng lợi nhuận += lợi nhuận;
                totalTrades++;
                nếu (lợi nhuận > 0) {
                    giao dịch chiến thắng++;
                } khác {
                    mấtGiao dịch++;
                }
            }
        }
    }
}

// Hàm tìm Key Level (Hỗ trợ đa dạng/kháng cự)
đôi FindKeyLevel() {
    double high = iHigh(Biểu tượng(), 0, iHighest(Biểu tượng(), 0, MODE_HIGH, keyLevelPeriod, 1));
    thấp gấp đôi = iLow(Biểu tượng(), 0, iLowest(Biểu tượng(), 0, MODE_LOW, keyLevelPeriod, 1));
    lợi nhuận (cao + thấp) / 2; // Trung bình giữa cao và thấp được xem là cấp độ chính
}

// Hàm tìm Đường Xu Hướng (Trendline)
đôi FindTrendLine() {
    int bars = trendLinePeriod;
    tổng képX = 0, tổng Y = 0, tổngXY = 0, tổngXX = 0;
    đối với (int i = 0; i < thanh; i++) {
        tổngX += i;
        sumY += Đóng[i];
        sumXY += i * Đóng[i];
        tổngXX += i * i;
    }
    độ dốc kép = (các thanh * tổngXY - tổngX * tổngY) / (các thanh * tổngXX - tổngX * tổngX);
    độ dốc trở lại; // Độ dốc của đường xu hướng, dương là xu hướng tăng, âm là xu hướng giảm
}

応答済み

1
開発者 1
評価
(258)
プロジェクト
322
30%
仲裁
34
26% / 65%
期限切れ
10
3%
仕事中
2
開発者 2
評価
プロジェクト
1
0%
仲裁
4
0% / 50%
期限切れ
0
仕事中
3
開発者 3
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
4
開発者 4
評価
(104)
プロジェクト
127
24%
仲裁
23
30% / 52%
期限切れ
8
6%
5
開発者 5
評価
(298)
プロジェクト
477
40%
仲裁
105
40% / 24%
期限切れ
81
17%
取り込み中
パブリッシュした人: 2 codes
類似した注文
I have a MT5 Hull MTF Indicator that I like. I would like someone to add: 1) Time of day function (with start time and end time) so that it does not send messages during my night time. Default Start=0900 Default End=2300 2) Add to the Message (sound and email): so that it is Symbol+Buy-Or-Sell+Ask-OrBid Price+TimeFrame1 "/" TimeFrame2 I will send the indicator to the developer. Thank you
MT5 Expert Advisor (EA) Acquisition Request – Proven XAUUSD Martingale / Grid EA I am looking to purchase a fully developed, actively traded, and proven MT5 Expert Advisor for XAUUSD (Gold) that uses Martingale, Grid, Averaging, Recovery, or Hybrid Recovery techniques. Mandatory Verification Requirement To be considered, please provide: - MT5 Investor Password (Read-Only Access) for verification - Account Number /
Looking to buy profitable MT4/MT5 Expert Advisors (EAs). Requirements: • Fully automated • 6+ months backtest • 100+ trades • No martingale or grid systems Send: • Backtest report • Max drawdown • Markets traded • Brief strategy summary Only original EAs developed by you. Long-term collaboration available
DESCRIPTION: I require an experienced MQL5 developer to build a fully automated, multi‑engine, multi‑asset trend‑following trading system for MetaTrader 5. The system includes: Multiple TrendEngine instances (one per symbol) A PortfolioController that manages all engines Volatility‑regime detection Dual‑timeframe confirmation ATR‑based breakout logic ATR‑based stop management Micropyramiding Risk‑weighted satellites
Live chart [ expert is not executing trades on xauusd ] , Deleting Existing Parameter not in use , Live Chart Adjustments Only , No Need to Change anything else , expert will be live testing Throughout
Prepare expert for xauusd live chart [ expert is not executing trades on xauusd ] . Deletion and cleaning code . Trailing Stop Rule to follow the given method . Live Chart Only
Matriks programında güzel bir stratejim var, meta da kayıtlı olmayan iki indikatörümü de metaya yükledim, stratejim belli, ama robot oluşturmak konusunda bilgim eksik. Yardım istiyorum. Acil dönüş bekliyorum. 12-276 üssel ortalamayı hangi yöne keserse, alphatrend indikaörüde bunu desteklesin, kendi gömdüpüm diğer bir indikatörde seviyelere göre alsın satsın
Hi. Could you slightly rewrite my cBot for me to use a 5-minute chart without a fixed target? The stop should be a trailing stop at the level of the initial range
MT5 EA Developer for Structured ICT/SMC Market Logic Requirements Specification: I need an MT5 Expert Advisor only in MQL5. No indicator, no script, no DLL, and no external API. The EA must be built on a rule-based ICT/SMC-style framework with objective, backtestable logic. I am not looking for social-media-style ICT/SMC interpretation. I need a developer who can convert trading concepts into clear coding rules. The
Hi all, I am looking for a top-rated, experienced MQL5 developer to code Phase 1 (Retail Version) of an advanced Expert Advisor for MetaTrader 5. Key Requirements: 1. Pure Price Action Strategy: Uses H4 Trend Filter (Swing High/Low) and H1 Execution (Wick Scanning >= 66% & Engulfing Candlesticks). Places orders via Buy/Sell Limit at Fibonacci 50% level of the candle body (with Giant Candle threshold rules). 2

プロジェクト情報

予算
30 USD