指定

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

反馈

1
开发者 1
等级
(309)
项目
394
21%
仲裁
44
59% / 23%
逾期
48
12%
已载入
2
开发者 2
等级
(5)
项目
4
50%
仲裁
4
0% / 75%
逾期
0
空闲
3
开发者 3
等级
(90)
项目
118
17%
仲裁
44
23% / 39%
逾期
20
17%
空闲
4
开发者 4
等级
项目
0
0%
仲裁
0
逾期
0
空闲
5
开发者 5
等级
项目
0
0%
仲裁
0
逾期
0
空闲
6
开发者 6
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
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
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
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
Creating a chart composed of different assets, weighted by their trading lot size & quantity. Using this chart to trade the assets in those lot sizes &quantity (by hand or with an EA ) In other words: composing a private index or pair, plotting that as a chart and have the ability to trade it directly with an EA and/or one order click. Inspired by Basket Chart Creator
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
I am seeking an experienced and skilled developer to code an Expert Advisor (EA) for the MetaTrader platform based on a specific trading strategy. The developer must have expertise in building EAs, understanding complex trading strategies, and ensuring the final product is efficient and reliable. If you have the expertise and experience to successfully handle this project, looking forward to your proposal and your
The requirements for the order of robots XAUUSD and XAGUSD EURUSD forex in the STOP loss TAKE profit signal in this order, you can bring benefits to the changes in the market, that is, when the market changes frequently, it will also help to prevent losses and bring great profits
Craet and indicator which has 15 price source and set a T/F tick for each price source then make Bollinger bands and Rsi with BollingerBands just for true sorces and plot buy and sell signals on main chart based on some conditions and strategy.... i explained every thing clear in the zip file ... theres no need to display those indicators i just need to see their value for testing how indicator works inside chart

项目信息

预算
30+ USD
VAT (20%): 6 USD
总计: 36 USD
开发人员
27 USD
截止日期
 30  50 天