Spécifications

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

Répondu

1
Développeur 1
Évaluation
(373)
Projets
479
23%
Arbitrage
57
56% / 25%
En retard
55
11%
Chargé
2
Développeur 2
Évaluation
(5)
Projets
4
50%
Arbitrage
4
0% / 75%
En retard
0
Gratuit
3
Développeur 3
Évaluation
(90)
Projets
118
17%
Arbitrage
44
23% / 39%
En retard
20
17%
Gratuit
4
Développeur 4
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
5
Développeur 5
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
6
Développeur 6
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Commandes similaires
Acquire existing profitable Expert Advisor with source code for client investment portfolio - Full .mq5 code (clean & commented) - 4+ years backtest (Jan 2022 - Dec 2025, 100% tick data) - ~10% monthly return - Max DD ≤15% - No grid/martingale (strictly enforced) - 1-month forward test required - Send trade history + EA details for review - Demo EA file needed for backtest replication - Open to any currency
i need the multi-chain dex bot with set up and installation i need you to help me set the copy reading wallet on binance or phantom with capital for 100 Euro to 1 Million in one year
123c ea 30+ USD
i need to fix this it is returning invald 2025.12.25 23:08:31.011 Trades '700031908': failed prices for 0 [Invalid request] i want it fixed i use Ai to chek and this is what it report
I have an issue with my ninja script and i would like you to help me straighten things I wanted to create an indicator and i have the source code already but i am getting compiling errors on my NinjaTrader And i tried fixing the error it still same I sent 3 images here for you to understand the errors and i would like to ask if you can help me fix it so i can go ahead and compile my source code. Thanks
Good day, I would like to build an automated trading system for Ninjatrader using 2 MACD, a Supertrend, and a moving average indicator. I want the option to adjust the indicator settings, the ability to trade at three different times, and the option to receive alerts. I want to get an idea of what that will cost me. It will enter trades on all blue take one contract out at a fixed point, move the stop to break even
I need an MQL5 indicator that identifies reversals without repainting or placing signals with an offset. The goal is to minimize lag and reduce whipsaw trades. Desired results are similar to the attached image. Requirements: - No repainting - No signal offset - Emphasis on reducing lag - MQL5 compatible - Clear, concise code If you have the expertise to create a reliable, high-performance indicator, let's discuss
I'm looking for a skilled trader/developer to share a proven scalping strategy on M1-M5 timeframes without using Martingale, Grid trading, or Hedge. Requirements: - Minimum trade duration: 2 minutes - Lot size: <20 - Proof of skill: Provide MT4/MT5 trade history report (PDF/HTML) - No High Frequency Trades - GMT+1 timezone, flexible hours - Price negotiable, performance-based compensation possible If you're a
Good day, I would like to build an automated trading system for Ninjatrader using 2 MACD, a Supertrend, and a moving average indicator. I want the option to adjust the indicator settings, the ability to trade at three different times, and the option to receive alerts. I want to get an idea of what that will cost me. It will enter trades on all blue take one contract out at a fixed point, move the stop to break even
I have an indicator i need automated i use it manually and it plots arrows. Can you automate it for my Ninjatrader8? Do you need to see file? Expert Ninjatrader Developer can Bid for this project
Hi! I need a trading bot/robot to automate my trades. I don't need much complicated bot. I want it to enter, exit trade and can do this in matter of second or multiple times in a second. Should be able to adjust, put SL/TP in the same menu. Would appreciate your ideas! Please write to me before anything else

Informations sur le projet

Budget
30+ USD
Délais
de 30 à 50 jour(s)