Tarea técnica

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

Han respondido

1
Desarrollador 1
Evaluación
(285)
Proyectos
353
21%
Arbitraje
41
59% / 24%
Caducado
37
10%
Trabajando
2
Desarrollador 2
Evaluación
(5)
Proyectos
4
50%
Arbitraje
4
0% / 75%
Caducado
0
Libre
3
Desarrollador 3
Evaluación
(90)
Proyectos
118
17%
Arbitraje
44
23% / 39%
Caducado
20
17%
Libre
4
Desarrollador 4
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
5
Desarrollador 5
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
6
Desarrollador 6
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
I need smart, professional, and fast programmer for doing this project quickly, that have experience in EA with minimum 300 projects finish, and have good review and reputation from their client Share your link review, if you not qualified, dont apply! I will bidding the programmer from experience, review, reputation, price, and days working My EA using Moving Average, Average True Range, and using consecutives
I am in search of a skilled MQL5 developer with a proven ability to optimize trading robots across various assets, including synthetic indices like V75, Boom and Crash, gold, US30, US100, and more. I'm looking for an experienced developer to enhance my multi-asset trading EA, which was originally developed exclusively for V75 and is based on the smart money concept. This comprehensive EA, based on an market indicator
Hello I am looking for a developer to help me backtest my custom ninjatrader 8 strategy andake it work perfectly your expertise is highly need for this project kindly reach out to me and let proceed
Hello please I need a developer to help me fix errors on my Ninjatrader 8 strategy I and make it work perfectly your expertise is need for this project kindly reach out to me and let's proceed
Must be an overlay ea so I can attach indicator and ea too the chart separately so I can change the settings( I use different setting too default ) dark is free on the mql4 market. I want auto lots Time filter. Tp and sl should be the same as the indicator I GET PAID NEXT FRIDAY SO I CAN PAY THEN
Hi there, I am looking for someone that would be interested in some more work. I do have a lot of work going on and could use help of some developers. I normally pay between 20-50 USD per job depending on complexity. It can be simple as RSI/MA EAs, grids, licensing system (remote ones) or more advanced jobs. But in general I do get a lot of straight forward job. If anyone is interested please do let me know. I am
Respected Madam I need an EA in Mql5 which can Buy at certain Increment of points like 100 then 50 then 50 then 25 then 25 then 25 then 25. Possibility of Grid increase. Buys at certain fixed level if the the Price drops like 100 points down then again 100 points down then again 100 points down like this in a grid system, Grid size I will declare. Grid order systems with stop loss and Multiple Reorders if the Stop
Trading Gold , tap in & join the ride of the trading platform and watch us grow as the days go on , we're looking forward to have you on board the journey
Komogo 30 - 75 USD
Hey 👋 Man . As discussed with you . I want to convert the Tradingview pinescript indicator I sent to you to MT5 Expert Advisor based on the EA conditions I sent to you . kindly apply for this project and let proceed.Thanks
Hello! Same as title. I need a forex, crypto or stocks trading strategy that can be automated and also can compound profits that makes at least 100% return of investment per month. It should be backtested and provide good steady results and a relative/maximum low drawdown would be nice as well! The strategy should be able to be automated into a bot and run 24/7 on a vps if needed. The strategy can be one that you

Información sobre el proyecto

Presupuesto
30+ USD
IVA (20%): 6 USD
Total: 36 USD
Para el ejecutor
27 USD
Plazo límite de ejecución
de 30 a 50 día(s)