Spécifications


*Strategy:*

- Buy when the 50-day moving average crosses above the 200-day moving average
- Sell when the 50-day moving average crosses below the 200-day moving average

*Code:*
```
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
int OnInit()
{
   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Script deinit function                                            |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   ObjectDelete(_MA50);
   ObjectDelete(_MA200);
}

//+------------------------------------------------------------------+
//| Script tick function                                              |
//+------------------------------------------------------------------+
void OnTick()
{
   double ma50 = iMA(Symbol(), PERIOD_CURRENT, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
   double ma200 = iMA(Symbol(), PERIOD_CURRENT, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
   
   if (ma50 > ma200 && OrderSend(_Symbol, OP_BUY, 0.1, Ask, 3, Bid-20*Point, Bid+20*Point, "MyOrder", 0, 0, Green) == ORDER_RETCODE_DONE)
   {
      Comment("Buy order executed");
   }
   
   else if (ma50 < ma200 && OrderSend(_Symbol, OP_SELL, 0.1, Bid, 3, Ask-20*Point, Ask+20*Point, "MyOrder", 0, 0, Red) == ORDER_RETCODE_DONE)
   {
      Comment("Sell order executed");
   }
}

//+------------------------------------------------------------------+
//| Script deinit function                                            |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   ObjectDelete(_MA50);
   ObjectDelete(_MA200);
}
```
This code creates a simple moving average crossover strategy, buying when the 50-day MA crosses above the 200-day MA and selling when it crosses below.

Répondu

1
Développeur 1
Évaluation
(2)
Projets
3
0%
Arbitrage
0
En retard
0
Gratuit
2
Développeur 2
Évaluation
(16)
Projets
17
12%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
3
Développeur 3
Évaluation
(32)
Projets
53
36%
Arbitrage
4
25% / 50%
En retard
6
11%
Occupé
4
Développeur 4
Évaluation
(54)
Projets
159
69%
Arbitrage
4
100% / 0%
En retard
1
1%
Gratuit
5
Développeur 5
Évaluation
(2397)
Projets
3010
65%
Arbitrage
76
47% / 14%
En retard
340
11%
Travail
6
Développeur 6
Évaluation
(2)
Projets
1
0%
Arbitrage
2
0% / 0%
En retard
0
Travail
7
Développeur 7
Évaluation
(54)
Projets
73
44%
Arbitrage
21
14% / 67%
En retard
8
11%
Gratuit
8
Développeur 8
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
9
Développeur 9
Évaluation
(1119)
Projets
1421
62%
Arbitrage
21
57% / 10%
En retard
43
3%
Gratuit
10
Développeur 10
Évaluation
(43)
Projets
50
28%
Arbitrage
2
0% / 0%
En retard
0
Travail
11
Développeur 11
Évaluation
(560)
Projets
927
48%
Arbitrage
301
59% / 25%
En retard
123
13%
Chargé
Commandes similaires
Hello developers here, I need a professional developer that can help me to develop an mt5 trading bot that works according to my strategy, I will be sharing my strategy in the inbox, Let me know if you can develop it, I will be waiting for your response
I need a telegram group or channel scrapper, that's capable of extracting members of a specific telegram group and auto add them to another telegram channel or group. Please let me know what we need to get this done. Thanks
Hi I want you to make software, let's give the software a name " rocky", I want to explain the project to understand the possibility, example: let's assume I have a computer and there is some internet browsers open, now the software "rocky" you will make is monitoring the computers full screen or a region of screen continuesly and as soon as the internet browser updates with some graphical changes (which is the text
I am looking developer who can code pocket option data and insert in to costume candle Heikin in trading view. I want to trade otc as such its up to developer to get pocket option data stream and then make costume candle Heikin inside of trading view. Their will be a drop down menu in setting that will use to pick the otc pair. Developer must have way to chat on mobile app also. We will use
I need an EA in based of this indicator. It have buffers. The owner told me it..., So I need an expert who can do this I will attached the file right now
HI, I'm looking for an experienced person who can add buy/sell indications and Alerts on existing Pinescript along with little modification of the script and the script should connect to MT5 platform using pineconnector MT5 platform should excute trade instantly as based on the alerts/indications on tradingview script
My Ea is currently closing orders in Drawdow and is making loss after loss I need someone with coding experience to help me fix this problem and also make a couple of visual changes pls text me first I can explain everything more detailed n
Position: Telegram Bonk Bot Type Developer Budget: $150 Start Date: Immediate Project Overview: We are seeking an experienced and skilled Telegram Bot Developer to complete and launch an advanced TG BOT Notification and Automated Trading Bot. This bot is designed to provide real-time notifications about new token info and execute automated trades based on user-defined preferences. 😁 The core functionality and
HI, I'm looking for an experienced person who can add buy/sell indications/Alerts on existing Pinescript code along with little modification of the script and the script should connect to MT5 platform using pineconnector MT5 platform should execute trade instantly as based on the alerts/indications on tradingview script
Hello i need an expert who can help me backtest my Grid system EA and find the best profitable setting where i can use it on a live account. Note: Only applicant with experience and prove of work should apply

Informations sur le projet

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

Client

Commandes passées1
Nombre d'arbitrages0