Simple MA Crossover with very powerful money management for MQL5 (BOT)

MQL5 Uzman Danışmanlar

İş Gereklilikleri

i would like someone to create a bot for me that trades volatility 50 (1s) and volatility 75 index. Setting the required stop losses and take profit, following trends while using the martingale function. i start with 5usd......and please tell me the cost of this bot. this is a bot i tried creating on chatgpt.

 //+------------------------------------------------------------------+

//| Expert Advisor using CCI (200), Stochastic (60,1,2), and ATR    |

//+------------------------------------------------------------------+

#include <Trade/Trade.mqh>

CTrade trade;


// Indicator Handles

int cciHandle, stochHandle, atrHandle;


// Indicator Buffers

double cciBuffer[];

double kBuffer[];

double atrBuffer[];


// Risk Management Parameters

input double ATRMultiplier = 1.5;  // Multiplier for ATR-based SL/TP

input double BreakEven = 10;       // Move SL to break-even after this profit (in points)

input double LotSize = 0.007;      // User-defined lot size

input double ProfitLock = 20;      // Lock in profits after this amount

input double MaxDrawdownPerTrade = 2; // Maximum drawdown per trade in percentage

input double MaxAccountDrawdown = 10; // Maximum account drawdown in percentage

double AdjustedLotSize;            // Internal adjustable lot size


//+------------------------------------------------------------------+

//| Function to check and adjust lot size                           |

//+------------------------------------------------------------------+

void CheckLotSize()

{

    double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);

    double stepLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);


    AdjustedLotSize = LotSize;

    if (AdjustedLotSize < minLot)

    {

        Print("Warning: Lot size too small. Adjusting to minimum allowed: ", minLot);

        AdjustedLotSize = minLot;

    }

    AdjustedLotSize = NormalizeDouble(AdjustedLotSize / stepLot, 0) * stepLot;

}


//+------------------------------------------------------------------+

//| Initialization function                                         |

//+------------------------------------------------------------------+

int OnInit()

{

    CheckLotSize();

    

    cciHandle = iCCI(_Symbol, PERIOD_M5, 200, PRICE_TYPICAL);

    stochHandle = iStochastic(_Symbol, PERIOD_M5, 60, 1, 2, MODE_SMA, STO_LOWHIGH);

    atrHandle = iATR(_Symbol, PERIOD_M5, 14);

    

    return INIT_SUCCEEDED;

}


//+------------------------------------------------------------------+

//| Main trading logic                                              |

//+------------------------------------------------------------------+

void OnTick()

{

    if (CopyBuffer(cciHandle, 0, 0, 2, cciBuffer) <= 0) return;

    if (CopyBuffer(stochHandle, 0, 0, 2, kBuffer) <= 0) return;

    if (CopyBuffer(atrHandle, 0, 0, 1, atrBuffer) <= 0) return;

    

    double cciCurrent = cciBuffer[0];

    double cciPrevious = cciBuffer[1];

    double stochK = kBuffer[0];

    double atrValue = atrBuffer[0] * ATRMultiplier;

    

    double priceAsk = SymbolInfoDouble(_Symbol, SYMBOL_ASK);

    double priceBid = SymbolInfoDouble(_Symbol, SYMBOL_BID);


    Print("CCI Current: ", cciCurrent, " Stochastic K: ", stochK, " ATR: ", atrValue);

    

    // Buy condition: CCI crosses above -100 and Stochastic is below 50

    if (cciPrevious < -100 && cciCurrent > -100 && stochK < 50)

    {

        double sl = priceAsk - atrValue;

        double tp = priceAsk + (atrValue * 1.5);

        trade.Buy(AdjustedLotSize, _Symbol, priceAsk, sl, tp);

        Print("Buy order executed at ", priceAsk);

    }

    

    // Sell condition: CCI crosses below 100 and Stochastic is above 50

    if (cciPrevious > 100 && cciCurrent < 100 && stochK > 50)

    {

        double sl = priceBid + atrValue;

        double tp = priceBid - (atrValue * 1.5);

        trade.Sell(AdjustedLotSize, _Symbol, priceBid, sl, tp);

        Print("Sell order executed at ", priceBid);

    }

}


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(21)
Projeler
20
10%
Arabuluculuk
2
50% / 50%
Süresi dolmuş
0
Serbest
2
Geliştirici 2
Derecelendirme
(117)
Projeler
141
45%
Arabuluculuk
10
80% / 0%
Süresi dolmuş
0
Serbest
3
Geliştirici 3
Derecelendirme
(379)
Projeler
533
53%
Arabuluculuk
25
56% / 24%
Süresi dolmuş
6
1%
Çalışıyor
4
Geliştirici 4
Derecelendirme
(21)
Projeler
23
26%
Arabuluculuk
2
100% / 0%
Süresi dolmuş
0
Serbest
5
Geliştirici 5
Derecelendirme
(43)
Projeler
59
22%
Arabuluculuk
11
18% / 27%
Süresi dolmuş
5
8%
Yüklendi
6
Geliştirici 6
Derecelendirme
(1)
Projeler
3
0%
Arabuluculuk
0
Süresi dolmuş
0
Çalışıyor
7
Geliştirici 7
Derecelendirme
(92)
Projeler
113
24%
Arabuluculuk
12
42% / 25%
Süresi dolmuş
8
7%
Serbest
8
Geliştirici 8
Derecelendirme
(523)
Projeler
597
33%
Arabuluculuk
33
39% / 42%
Süresi dolmuş
9
2%
Meşgul
9
Geliştirici 9
Derecelendirme
(5)
Projeler
6
17%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
10
Geliştirici 10
Derecelendirme
(64)
Projeler
71
6%
Arabuluculuk
32
16% / 38%
Süresi dolmuş
6
8%
Meşgul
11
Geliştirici 11
Derecelendirme
(10)
Projeler
9
11%
Arabuluculuk
5
0% / 80%
Süresi dolmuş
2
22%
Çalışıyor
12
Geliştirici 12
Derecelendirme
(4)
Projeler
4
0%
Arabuluculuk
1
0% / 0%
Süresi dolmuş
1
25%
Çalışıyor
13
Geliştirici 13
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
14
Geliştirici 14
Derecelendirme
(145)
Projeler
191
19%
Arabuluculuk
18
44% / 17%
Süresi dolmuş
0
Serbest
15
Geliştirici 15
Derecelendirme
(587)
Projeler
1389
59%
Arabuluculuk
30
80% / 0%
Süresi dolmuş
10
1%
Serbest
16
Geliştirici 16
Derecelendirme
(493)
Projeler
527
53%
Arabuluculuk
12
67% / 17%
Süresi dolmuş
3
1%
Serbest
17
Geliştirici 17
Derecelendirme
(149)
Projeler
267
35%
Arabuluculuk
12
25% / 58%
Süresi dolmuş
42
16%
Serbest
18
Geliştirici 18
Derecelendirme
(80)
Projeler
116
16%
Arabuluculuk
4
25% / 25%
Süresi dolmuş
10
9%
Çalışıyor
19
Geliştirici 19
Derecelendirme
(11)
Projeler
11
36%
Arabuluculuk
1
100% / 0%
Süresi dolmuş
0
Serbest
20
Geliştirici 20
Derecelendirme
(214)
Projeler
219
29%
Arabuluculuk
0
Süresi dolmuş
3
1%
Serbest
21
Geliştirici 21
Derecelendirme
(1)
Projeler
0
0%
Arabuluculuk
1
0% / 0%
Süresi dolmuş
0
Serbest
22
Geliştirici 22
Derecelendirme
(2514)
Projeler
3168
66%
Arabuluculuk
77
48% / 14%
Süresi dolmuş
340
11%
Çalışıyor
23
Geliştirici 23
Derecelendirme
(19)
Projeler
23
30%
Arabuluculuk
2
50% / 50%
Süresi dolmuş
0
Çalışıyor
24
Geliştirici 24
Derecelendirme
(42)
Projeler
88
14%
Arabuluculuk
32
28% / 59%
Süresi dolmuş
36
41%
Çalışıyor
25
Geliştirici 25
Derecelendirme
(270)
Projeler
546
49%
Arabuluculuk
55
40% / 36%
Süresi dolmuş
226
41%
Çalışıyor
Benzer siparişler
Hello Developers, I am looking for a highly skilled and experienced MQL5 developer to modify and enhance an existing grid trading system. The system is currently designed to trade in a single direction (either Long or Sell), but it needs to be modified to execute trades in both directions simultaneously with different lot sizes, following specific trade execution and risk management rules. Project Requirements: Dual
Hello here, i need an expert to help me convert my Tradingview indicator to mt5 I have indicator on MT5 I want to convert them to Tradingview I have the source code of it
Hello great developer I want converted pine script to a ninja script without any of the functionality gone Can you do that? Also the time filter should have an on/off toggle. I will be looking for a great developer and ready for Job in few day to bid for it
I need someone experienced in Quantower scripting and debugging to help with: Testing the strategy to ensure it runs correctly Identifying and fixing errors in execution or logic Optimizing the code for better performance If you have experience with C# scripting, Quantower automation, or algo trading, kindly drop your comment or text me on Tel. (@pextron)
In Tradovate it is possible to create groups and trade several accounts at the same time. But the group is not displayed in Tradingview, you can only trade groups in Tradovate itself. Is it possible to program an app in Tradingview that does the following: 1. Display the Tradovate group and trade it? 2. Select an account that then automatically sends the trades to the group in Tradovate? 3. Select a main account in
EA Modification; (Appologies the text format window here did not display the requirement format properly so took a screenshot from words and copied that here instead both for the requirement below and the EA summary (for reference only) further below) Context of the Existing EA; Please give a meaningful description for the job. Text must contain at least 30 words. Replication of phrases via copy and paste is
First of all the expert advisor must come with the things to put before it starts or if not put the default will work. 1input - Pattern - any pattern detected like head and shoulder , double top , gartley 2,2,2 2nd input - Market sentiments - says overall market trends - bearish , bullish 3rd input - Priority timeframe - like 30min 4th input - moving average priority timeframe 5th input -liquidation zone
MT5 INDICATOR/EA 30 - 150 USD
I'm looking for an experienced MQL5 developer to clean up and complete a partially coded Market Structure Indicator for MT5. This indicator will identify key Breaks of Structure (BOS) and Change of Character (CHOC) events in price action. I will provide the work-in-progress (WIP) code and can walk you through the logic in a video call if needed to ensure clear understanding. Scope of Work: 1. Fix and complete the
A supertrend ea with: - martingale that resets back to initial lot size only after a specified number of wins in a row. - Immediately when I place it on the chart, I want it to check the past signals and determine the current number of losses in a row according to the set TradeDirection, TakeProfit and StopLoss. (Look at the historical data to check the past signals and determine the current number of losses in a
I Need Scalping EA 50 - 150 USD
I need to use stochastic oscillator indicator to develop a n EA based. The rule of buy is when the fast moving average on the Stochastic Oscillator oscillator is moving from below to upwards the set level say 10 and the candle close we open a buy the the stop loss is to be put below the the previous low then opposite for the sell order exit on opposite signal if the price moves above the 45 level we go at break even

Proje bilgisi

Bütçe
30 - 100 USD

Müşteri

Verilmiş siparişler1
Arabuluculuk sayısı0