Termos de Referência

// Setting the initial parameters
double capital = 1000;
double risk = 0.015; // 1.5% stop loss
double take_profit = 0.10;
double lot_size = 0.10;
int max_executions = 6;

// Calculating the Ichimoku indicator
int period1 = 9;
int period2 = 26;
int period3 = 52;
int period4 = 26;

double tenkan_sen[];
double kijun_sen[];

int init()
{
    // Calculate the Ichimoku indicator
    ArrayResize(tenkan_sen, Bars);
    ArrayResize(kijun_sen, Bars);
    for (int i = 0; i < Bars; i++)
    {
        double ichimoku[4];
        iIchimoku(Symbol(), 0, period1, period2, period3, period4, PRICE_HIGH, ichimoku);
        tenkan_sen[i] = ichimoku[0];
        kijun_sen[i] = ichimoku[1];
    }

    return (0);
}

int start()
{
    // Implementing the trading strategy
    static int position = 0; // 0 represents no position, 1 represents long position
    static int executions = 0; // Number of executions
    double stop_loss, take_profit_price;
    
    for (int i = 1; i < Bars; i++)
    {
        if (tenkan_sen[i - 1] > kijun_sen[i - 1] && tenkan_sen[i] < kijun_sen[i] && position == 0)
        {
            if (executions < max_executions)
            {
                position = 1;
                executions++;
                stop_loss = iClose(Symbol(), 0, i) * (1 - risk);
                take_profit_price = iClose(Symbol(), 0, i) * (1 + take_profit);
                capital -= lot_size * iClose(Symbol(), 0, i); // Entering the market
            }
        }
        else if (tenkan_sen[i - 1] > kijun_sen[i - 1] && tenkan_sen[i] < kijun_sen[i] && position == 1)
        {
            position = 0;
            executions--;
            capital += lot_size * iClose(Symbol(), 0, i); // Exiting the market
        }
        else if (iClose(Symbol(), 0, i) < stop_loss && position == 1)
        {
            position = 0;
            executions--;
            capital += lot_size * stop_loss; // Exiting the market with stop loss
        }
        else if (iClose(Symbol(), 0, i) > take_profit_price && position == 1)
        {
            position = 0;
            executions--;
            capital += lot_size * take_profit_price; // Exiting the market with take profit
        }
    }
    
    // Print the final capital
    Print("Final Capital: $", capital);

    return (0);
}

Respondido

1
Desenvolvedor 1
Classificação
(309)
Projetos
394
21%
Arbitragem
44
59% / 23%
Expirado
48
12%
Carregado
2
Desenvolvedor 2
Classificação
(5)
Projetos
4
50%
Arbitragem
4
0% / 75%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(90)
Projetos
118
17%
Arbitragem
44
23% / 39%
Expirado
20
17%
Livre
4
Desenvolvedor 4
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
5
Desenvolvedor 5
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
6
Desenvolvedor 6
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
Hello. I would like to get a TOS script converted to Tradingview for my alerts. I’m haven’t a hard time getting my entry point because the script does not fire off alerts on thinkorswim. I will send the script so you can see if it’s possible
Here's a clearer step-by-step guide to checking the last 50 candles on your chart and applying Fibonacci retracement levels based on their colors: Identify Candle Color: Start from the 100th candle from the left on the chart and check its color. If the 100th candle is green (i.e., the close is higher than the open): Draw a Fibonacci Retracement: From the highest price to the lowest price of this candle. Check the
Hello, I would like an experienced programmer to create an EA trading system which opens and closes trades very fast within seconds (HFT). To have an option/button to activate either for only buy or only sell (one way trading) would be optimal. With a nice GUI. Implementing your own experience with HFT trading systems is welcomed. It's for volatile markets such as XAUUSD or US30. Taking advantage of order placements
The strategy is a martingale type . i.e if it hits the stop loss , it will double the lot size and place again in that direction, and when it hits the take profit at any level of the martingale, it will start over from the first lot size used initially
I want you to make me an indicator in Training View. Its idea is very simple, and I want it to have an alarm. Here's a clearer step-by-step guide to checking the last 50 candles on your chart and applying Fibonacci retracement levels based on their colors: Identify Candle Color: Start from the 100th candle from the left on the chart and check its color. If the 100th candle is green (i.e., the close is higher than the
Hello, is it possible to be made accommodation of provided signal for Forex for mt4? I bought a signal for multiple pairs. it is executing all pair.I want to use it on couple of pairs.Is it possible to be made some modifications?I do not have codes for the signal
Hi i need expert to MT5 Read all trades by one magic number for example ( in the same account have a lot magics different ) and read one magic for example 222, and all trades open the sum for example is = 2.5 positive close all trades for magic number 222 equal this example https://www.mql5.com/en/market/product/83766?source=Site +Search#description
I have an MT4 indicator, I want to receive an alert on WhatsApp when the indicator gives a buy or sell signal, I already have an API that will send the message, just send the json with the content, I will pass the API link when I have the proposal: { "symbol": "xauusd", "cellphonenumber": "00000000", "message": "test" }
I want a program that automatically disables manual trade execution once a specified number of trades have already been placed on that given day. ie. After a total of 3 trades have been placed on that day, manual trade execution should be disabled. I want the program to also limit the amount of lots that can be traded in any given day. ie. Maximum of 15 standard lots in any given day. The program should disable
Hello, I am highly in need of a professional and expert developer who is capable to convert my tradingview indicator to MT5, if you can perfectly do this project kindly meet me at the comment section to proceed

Informações sobre o projeto

Orçamento
30+ USD
IVA (20%): 6 USD
Total: 36 USD
Desenvolvedor
27 USD
Prazo
de 30 para 50 dias