Bottrading

Termos de Referência

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

Respondido

1
Desenvolvedor 1
Classificação
(146)
Projetos
175
23%
Arbitragem
7
29% / 43%
Expirado
4
2%
Ocupado
2
Desenvolvedor 2
Classificação
Projetos
1
0%
Arbitragem
0
Expirado
0
Trabalhando
3
Desenvolvedor 3
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
The Trading View Indicator script has about 80% of what I need. 1. I have an additional entry model called a confirmation entry 2. I normally just look back 3-50 bars to determine if a bar is wide range or not, but the 3 additional WRB models require requirements based on 3 bars before it, and each one has its own name. 3. The TV indicator has a lot of visual cosmetics that we won't be able to do in MT5, but colour
Hello, I am looking for a developer to reconstruct an indicator that is currently in an ex4 file into an mq4 file. The indicator provides buy and sell signals with entry points, Stop Loss, and TP1, TP2, and TP3. However, the indicator has some errors, and I would like to correct them. Unfortunately, since I only have the ex4 file, it's not possible to make these corrections directly. Therefore, I would like to
very simple rule buy rate 2 sl 1 if market reach 3 sl 2 market reach 4 sl 3 sl hit reverse trade open too with same 1:1 trail sl system if sl hit reverse trade open with same sl trail function 1 input open trade with buy or sell option 2 sl in pip .............xyz 3 lot size ............. xyz 4 distance from sl when sl trail one step [main point] Iam buying in rate of 2 my sl is 1 market reach 3 my sl is 2 market
I’m looking for someone experienced with Think or Swim to create a backtesting script for an in-the-money Iron Condor strategy using options on the SPX. The strategy involves setting up 10 contracts of an Iron Condor with a 10-point spread width and a net credit requirement of $11 per contract. The goal is to backtest the performance over the last three years, focusing on trades where the SPX closes outside a
Hello, I have a physically trading keyboard and i want to connect it with tradelocker, mt4,mt5 and ctrader. People need to be able to open and close a position with the keyboard really fast. i need it on macos, windows and linux. (desktop) My competition is: www.magickeys.trade My goal is to be the number 1 to sell the keyboards + software. When people order a tradingkeyboard they will get a mail after the purchase
Job Title: Expert Advisor (EA) Developer for Forex Trading Job Description: I am seeking an experienced Expert Advisor (EA) developer to create a customized trading bot for the MetaTrader 4/5 platform. The bot will be designed to execute a sophisticated trading strategy that incorporates daily range calculations, cost averaging, and hedging with precise pip management. The successful candidate should have strong
Hello, I have built and EA with FX Dreema ( https://fxdreema.com/ ) that uses the maximum and minimum vales of the previous candle to entry on a trade. After that, I put a Stop Loss and Trailing Stop on that order, and goes as the market follows up and down. First, I recognize what I'm asking in this project may not be possible. I know about the differences in results comparing Strategy Tester with Real and Live
I need an expert advisor based on MACD and MA signals. It must have check and handling of trade operations errors. The main criteria for opening and closing positions: ◇Both Main and Signal direction must be shown by Arrows which is going to be for buy and sell positions
Trendline expert 40 - 200 USD
My project is to put my strategy on the VCrush indicator. I already have the indicator, I just need to add the entry methods, take and stop rules. There are 5 lines in total, when these lines are aligned, the robot makes the entry. Below are two images of what the buy and sell entries would look like with the lines aligned
I need an expert to help me with adding more features to my existing mt4 EA I think the addition I want added to this EA is fairly simple--but I don't really understand how programming works, Contact me for a long term work, This is not the only project, I will explain the features in the inbox, Let me know if you can do it

Informações sobre o projeto

Orçamento
30 USD

Cliente

Pedidos postados1
Número de arbitragens0