Bottrading

Şartname

// 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
}

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(265)
Projeler
333
29%
Arabuluculuk
36
28% / 64%
Süresi dolmuş
10
3%
Yüklendi
2
Geliştirici 2
Derecelendirme
Projeler
1
0%
Arabuluculuk
4
0% / 50%
Süresi dolmuş
0
Çalışıyor
3
Geliştirici 3
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(106)
Projeler
129
25%
Arabuluculuk
23
30% / 52%
Süresi dolmuş
8
6%
Serbest
5
Geliştirici 5
Derecelendirme
(298)
Projeler
478
40%
Arabuluculuk
105
40% / 24%
Süresi dolmuş
82
17%
Yüklendi
Yayınlandı: 2 kod
Benzer siparişler
Привіт. Шукаю когось, хто б застосував мій код як бота . Я торгую індексом Aus_200 SFE (не XJO). Бот базується на MACD входу/виходу, RSI, стохастиці та vwap. Як тільки роботу приймуть, мені потрібно внести кілька коректив; однак, нічого суттєвого. Дякую
I have a technical specification ready for a custom alert indicator in NinjaTrader 8 (NinjaScript / C#). Important clarification: it is NOT an automatic trading bot, it is solely a visual indicator (arrows/lines on the chart) and sound alerts (notifications) based on EMA crossovers and range breakouts (ORB 15m) on lower timeframes for futures (MES). I already have the exact rules written out unambiguously
Custom MT5 EA for buy stop and sell stop breakout strategy.’ ‘Requirements, develop a custom Expert Advisor for MetaTrader 5 that places buy-stop and sell-stop pending orders based on defined breakout rules.’ ‘All important values adjustable via inputs.’ ‘Includes stop loss, take profit, trailing stop, and configurable risk management.’ ‘One trade at a time, works on demo before live.’ Provide source code and
A good trend predicting indicator is the one which can identify the trend change as soon as it happens on the chart. when a new candle is formed it should tell whether its going to go up or down. I have already seen a lot of repainting trend predictors so if your indicator is repainting then please don't bother contacting. I would like to see the demo version and then if satisfied , I would want the source code too
Looking for A verifiable, disciplined XAUUSD analyst with controlled drawdown, consistent stop-loss use, clear communication and the capacity to service a live community. To send daily London and New York signals exclusively in my channel on Telegram
Platform MetaTrader 5 (MT5) MQL5 Source Code Required Compatible with Exness MT5 both standard and cent accounts/ICMarket accounts Works on EUR/USD only (initial version) ⸻ Objective Develop a fully automated AI Expert Advisor based on ICT Smart Money Concepts (SMC). The EA must only execute high-probability trades that satisfy all required conditions before opening a position. The EA must avoid overtrading and
Bonjour, je recherche un développeur MQL5 expérimenté pour créer un Expert Advisor pour MetaTrader 5 basé sur une stratégie de trading intégrant des principes de gestion des risques rigoureux et d'intelligence financière. Le robot doit être capable de gérer plusieurs paires de devises et d'optimiser automatiquement les entrées et sorties en fonction de conditions de marché prédéfinies."
MT4/MT5 HFT EA us30 30 - 3000 USD
Hello everybody, I'm looking for an experienced MQL4/MQL5 developer to optimize a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5. The EA performs consistently and profitably on demo accounts, but when it is run on Raw and Standard live accounts under what appear to be the same trading conditions, it begins generating losses. I do not have the original source code (.mq4/.mq5); I only have the
I'm looking for an experienced NinjaTrader 8 (C#) developer to build a fully automated futures trading strategy. Please apply only if you have proven experience developing and testing NinjaTrader strategies. Project Overview Develop a fully automated NinjaTrader 8 strategy. Designed for Apex funded and evaluation accounts. Primary instruments: NQ/MNQ Futures (with flexibility to support other futures later). Trading
Code An Loss Rate 90-100% MT5 EA , that can blow a 100 USD account a day ,with fixed TP of 3000 points and SL of 3000 For better Rate Calculations get an strategy that can lead to so

Proje bilgisi

Bütçe
30 USD