Buy and sell moving average

MQL5 Experts

Termos de Referência

// Define input parameters
input int fastEMA_Period = 10; // Fast EMA period
input int slowEMA_Period = 20; // Slow EMA period

// Define global variables
double fastEMA, slowEMA;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
    // Calculate initial EMAs
    fastEMA = iMA(Symbol(), 0, fastEMA_Period, 0, MODE_EMA, PRICE_CLOSE);
    slowEMA = iMA(Symbol(), 0, slowEMA_Period, 0, MODE_EMA, PRICE_CLOSE);

    return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
    // Update EMAs
    fastEMA = iMA(Symbol(), 0, fastEMA_Period, 0, MODE_EMA, PRICE_CLOSE);
    slowEMA = iMA(Symbol(), 0, slowEMA_Period, 0, MODE_EMA, PRICE_CLOSE);

    // Generate buy signal when fast EMA crosses above slow EMA
    if (fastEMA > slowEMA)
    {
        Print("Buy signal! Fast EMA crossed above slow EMA.");
        // Implement your buy logic here
    }

    // Generate sell signal when fast EMA crosses below slow EMA
    else if (fastEMA < slowEMA)
    {
        Print("Sell signal! Fast EMA crossed below slow EMA.");
        // Implement your sell logic here
    }
}

Respondido

1
Desenvolvedor 1
Classificação
(146)
Projetos
172
23%
Arbitragem
7
29% / 43%
Expirado
4
2%
Trabalhando
2
Desenvolvedor 2
Classificação
(2086)
Projetos
2646
61%
Arbitragem
113
45% / 26%
Expirado
418
16%
Trabalhando
3
Desenvolvedor 3
Classificação
(18)
Projetos
24
42%
Arbitragem
0
Expirado
0
Trabalhando
4
Desenvolvedor 4
Classificação
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
5
Desenvolvedor 5
Classificação
(5)
Projetos
6
17%
Arbitragem
0
Expirado
0
Livre
6
Desenvolvedor 6
Classificação
(343)
Projetos
466
52%
Arbitragem
22
50% / 27%
Expirado
5
1%
Carregado
7
Desenvolvedor 7
Classificação
(512)
Projetos
773
63%
Arbitragem
33
27% / 45%
Expirado
23
3%
Livre
8
Desenvolvedor 8
Classificação
Projetos
0
0%
Arbitragem
1
0% / 100%
Expirado
0
Livre
9
Desenvolvedor 9
Classificação
(1130)
Projetos
1432
62%
Arbitragem
21
57% / 10%
Expirado
43
3%
Livre
10
Desenvolvedor 10
Classificação
(350)
Projetos
553
32%
Arbitragem
24
67% / 8%
Expirado
16
3%
Livre
11
Desenvolvedor 11
Classificação
(14)
Projetos
18
67%
Arbitragem
2
50% / 50%
Expirado
3
17%
Livre
12
Desenvolvedor 12
Classificação
(87)
Projetos
109
25%
Arbitragem
9
44% / 22%
Expirado
8
7%
Trabalhando
13
Desenvolvedor 13
Classificação
(4)
Projetos
6
0%
Arbitragem
4
25% / 75%
Expirado
0
Livre
14
Desenvolvedor 14
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
15
Desenvolvedor 15
Classificação
(42)
Projetos
62
8%
Arbitragem
12
58% / 42%
Expirado
1
2%
Livre
16
Desenvolvedor 16
Classificação
(61)
Projetos
186
73%
Arbitragem
4
100% / 0%
Expirado
1
1%
Livre
17
Desenvolvedor 17
Classificação
(24)
Projetos
31
16%
Arbitragem
7
29% / 43%
Expirado
4
13%
Trabalhando
18
Desenvolvedor 18
Classificação
(1092)
Projetos
1448
45%
Arbitragem
49
73% / 12%
Expirado
36
2%
Livre
19
Desenvolvedor 19
Classificação
(13)
Projetos
18
28%
Arbitragem
2
0% / 100%
Expirado
4
22%
Trabalhando
20
Desenvolvedor 20
Classificação
(5)
Projetos
6
50%
Arbitragem
1
0% / 0%
Expirado
0
Trabalhando
21
Desenvolvedor 21
Classificação
(36)
Projetos
45
36%
Arbitragem
0
Expirado
0
Livre
22
Desenvolvedor 22
Classificação
(76)
Projetos
99
36%
Arbitragem
0
Expirado
3
3%
Trabalhando
23
Desenvolvedor 23
Classificação
(124)
Projetos
158
42%
Arbitragem
20
60% / 20%
Expirado
8
5%
Livre
24
Desenvolvedor 24
Classificação
(478)
Projetos
507
53%
Arbitragem
10
60% / 20%
Expirado
3
1%
Livre
25
Desenvolvedor 25
Classificação
(4)
Projetos
4
0%
Arbitragem
2
0% / 100%
Expirado
1
25%
Livre
26
Desenvolvedor 26
Classificação
(563)
Projetos
932
47%
Arbitragem
302
59% / 25%
Expirado
124
13%
Carregado
Pedidos semelhantes
Hello, I want to create an EA that can be able to take and optimise trade bids using the trend tracker concept I have developed. The tracker will monitor the 2 lines in the below pictures and then start to activate bids once they cross each other and then be able to manage all bids afterwards towards the direction of the market by opening and closing them intermittently and profitably until the position at the other
Hi man, How are u? I have an EA and I need to check few aspects of the code, if It works fine? I am looking for an expert coder, who can understand mt4 language and help us to solve this out. This job will hardly take about 3-4 hours max for an experienced coder, when explained detail. Also, I would like to give this to someone, who can understand and speak English well. Also, the coder should be able to come via
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA. THREE TYPES OF ENTRIES 1: AGGRESSIVE 2: DIVERGENCE 3
Indicator in use: Bollinger Bands Mechanism (See diagrams provided for help) Sells: 1. Trigger candle: When candle low is above the top Bollinger band - accurate to the lowest point scale (e.g. On EURUSD if candle low is 1.07915 and the value of top bollinger is 1.07914 - this is a sell signal; or if on Futures if the increment is .25 or .10 then this is used) 2. Enter sell ONLY on the next candle if price breaks
Indicator in use: Bollinger Bands Mechanism: (See diagrams provided for help) Sells: 1. Trigger candle: When candle low is above the top Bollinger band - accurate to the point scale (e.g. On EURUSD if candle low is 1.07915 and the value of top bollinger is 1.07914 - this is a sell signal) 2. Enter sell ONLY on the next candle if price breaks below the trigger candle LOW (using the e.g. above- if next candle price
hey guys, im looking for an auto mt5 license system through a web app i have already, i simply want it so a unique license key is generated for memebers, they input this onto the EA input and then it checks if its valid. active license per user capped at 5. i already have an mt5 coder and dec team for the app so i dont know if youd prefer to intergrate onto the webapp yourself or simply provide the code and doc so my
I need a simple panel to execute both buy and sell operations with very basic things like stopp loss take profit that functions for both market orders such as buy stop sell stop buy limit sell limit I don't care about colors or design I just want how you can do it what interests me most are the functions
I want to create an EA that can take bids according to information of a logic I have developed to give indication of a BUY or SELL opportunity. The EA will then be able to activate the BUY at the lowest possible position once the indicator clears it for a BUY and take bid upwards or identify the highest point and clears it for a SELL and take bids downwards. As you can see from example of JULY 2024 data to see how
We are seeking a skilled developer who can convert a Tradingview indicator written in Pinescript to a NinjaTrader indicator written in C#. The goal is to create a profitable trading strategy using this indicator. The successful candidate will have expertise in both Pinescript and C# programming languages, as well as a strong understanding of trading indicators and strategies. The main responsibilities will include
I am seeking an experienced MQL5 developer to create a user-friendly manual Grid Trading Expert Advisor (EA) with the following key features: Dynamic Grid Trading: Adjustable Grid Distance: Traders can manually input grid distance in pips via an intuitive, movable table. Take Profit Management: Fixed TP for the initial positions (e.g., first 5 trades). Stop-Loss (Optional): Traders can choose to use a stop-loss with

Informações sobre o projeto

Orçamento
100+ USD
Desenvolvedor
90 USD