Add stoploss to ea0130

Termos de Referência

//+------------------------------------------------------------------+
//|                                                     MyEA.mq5     |
//|                        Copyright 2024, Your Company Name        |
//|                                       http://www.yourwebsite.com|
//+------------------------------------------------------------------+
#property copyright "2024, Your Company Name"
#property link      "http://www.yourwebsite.com"
#property version   "1.00"
#property strict

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   // Place your initialization code here
   return INIT_SUCCEEDED;
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   // Place your deinitialization code here
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   // Place your trading logic here
   double stopLossDistance = 30.0; // Stop loss distance in pips
   double stopLossPrice = 0.0;     // Stop loss price
   double entryPrice = Ask();      // Get current ask price (assuming long trade)

   // Calculate stop loss price
   if (stopLossDistance > 0)
     {
      stopLossPrice = entryPrice - stopLossDistance * Point;
     }

   // Place stop loss order
   if (stopLossPrice > 0)
     {
      int ticket = OrderSend(Symbol(), OP_BUY, 0.1, entryPrice, 2, stopLossPrice, 0, "Stop Loss", 0, 0, clrNONE);
      
      if (ticket > 0)
        {
         Print("Stop loss order placed successfully at price ", stopLossPrice);
        }
      else
        {
         Print("Error placing stop loss order: ", GetLastError());
        }
     }
  }
//+------------------------------------------------------------------+

Respondido

1
Desenvolvedor 1
Classificação
(22)
Projetos
21
10%
Arbitragem
4
25% / 75%
Expirado
0
Livre
2
Desenvolvedor 2
Classificação
(633)
Projetos
1001
47%
Arbitragem
33
36% / 36%
Expirado
98
10%
Trabalhando
Publicou: 6 códigos
3
Desenvolvedor 3
Classificação
(1)
Projetos
1
0%
Arbitragem
1
0% / 100%
Expirado
1
100%
Livre
4
Desenvolvedor 4
Classificação
(37)
Projetos
59
27%
Arbitragem
26
19% / 54%
Expirado
10
17%
Trabalhando
Publicou: 1 código
5
Desenvolvedor 5
Classificação
(72)
Projetos
80
10%
Arbitragem
38
8% / 58%
Expirado
6
8%
Livre
6
Desenvolvedor 6
Classificação
(279)
Projetos
341
37%
Arbitragem
6
50% / 17%
Expirado
7
2%
Livre
Publicou: 5 códigos
7
Desenvolvedor 7
Classificação
(47)
Projetos
67
37%
Arbitragem
5
40% / 40%
Expirado
1
1%
Livre
8
Desenvolvedor 8
Classificação
(156)
Projetos
198
59%
Arbitragem
10
80% / 0%
Expirado
0
Trabalhando
Publicou: 1 código
9
Desenvolvedor 9
Classificação
(4)
Projetos
4
100%
Arbitragem
0
Expirado
0
Livre
10
Desenvolvedor 10
Classificação
(17)
Projetos
22
36%
Arbitragem
5
0% / 100%
Expirado
4
18%
Livre
11
Desenvolvedor 11
Classificação
(43)
Projetos
66
12%
Arbitragem
12
58% / 42%
Expirado
1
2%
Livre
12
Desenvolvedor 12
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
13
Desenvolvedor 13
Classificação
(15)
Projetos
19
16%
Arbitragem
5
40% / 40%
Expirado
0
Livre
14
Desenvolvedor 14
Classificação
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
15
Desenvolvedor 15
Classificação
(574)
Projetos
945
47%
Arbitragem
309
58% / 27%
Expirado
125
13%
Livre
16
Desenvolvedor 16
Classificação
(69)
Projetos
146
34%
Arbitragem
13
8% / 62%
Expirado
26
18%
Livre
Publicou: 6 códigos
17
Desenvolvedor 17
Classificação
(174)
Projetos
233
61%
Arbitragem
3
33% / 33%
Expirado
6
3%
Livre
Publicou: 1 código
Pedidos semelhantes
Hello, I am looking for someone who can help me to build a MT4/MT5 forex EA, by analyzing the trading history. You are responsible to find out trading logic behind the EA and Build a new EA that accurately replicates the existing strategy. I need someone who has proven previous experience to build a new EA by reverse engineering. Thanks
I am looking for an experienced MT4/MT5 developer to analyze my trading history and replicate the strategy in a new Expert Advisor (EA). The developer must have proven experience in reverse engineering strategies, analyzing trading data, and developing EAs across various trading methodologies. A deep understanding of XAUUDS and BTCUSD behavior, as well as chart analysis, is essential. Please note that we do not have
Title: MT5 Forex Trading Robot Development I need a MetaTrader 5 (MT5) Expert Advisor (EA) for automated Forex trading. Requirements: 1. The robot must be fully automated and capable of opening and closing trades without manual intervention. 2. Compatible with MetaTrader 5 (MT5). 3. Adjustable lot size, Stop Loss, and Take Profit settings. 4. Built-in risk management based on account balance. 5. Ability to trade
Risk management EA 30 - 200 USD
Looking to develop risk management EA for personal use probably commercially in the future. I want the EA to have a display panel with 0.1, 0.2, 0.5,1,2,3 percent risk management button. I also want BE, partial closure of 0.25,0.5,0.75 and full closure panel on both profit and loss. I’ll also like to include trailing stop, 2 trades max per day and BE+spread option. I’ll be attaching the image for a guidance on what
Sierra Chart Alerts to MT5 via Webhook (Alert Manager File Version) Objective: Create a Custom Study (ACSIL / C++) that monitors alerts from the Alert Manager file and forwards any valid alert directly to MT5 via an HTTP POST (Webhook) in JSON format. Additional Note: The study should allow adding any modifications in the future and provide clear insights into the alert points in Sierra Chart. 1. Data Flow Diagram
Ea.Mix 30+ USD
I am in need of a good scalping bot for gold or any currency pair. If you have one that is working, reach out. You must be able to provide a trial version so I can test the bot myself
A bot takes trades every few seconds until hit the profit with the same lots , i am attaching a picture as well. If anyone can do that please contact me i will give the account details
MT5 Expert Advisor Development Project Overview I am looking for an experienced MQL5 developer to build a custom MetaTrader 5 Expert Advisor based on a grid-cycle trading framework. This is not a standard grid EA . The system combines: Session-based trade initiation Multi-filter signal generation Dynamic grid management Advanced basket management State-machine-driven trade lifecycle management Dynamic take-profit
I have a MT5 Hull MTF Indicator that I like. I would like someone to add: 1) Time of day function (with start time and end time) so that it does not send messages during my night time. Default Start=0900 Default End=2300 2) Add to the Message (sound and email): so that it is Symbol+Buy-Or-Sell+Ask-OrBid Price+TimeFrame1 "/" TimeFrame2 I will send the indicator to the developer. Thank you
i have built a indicator on trading view which is veryt good, its based on liquidity sweeps on stop losses. im looking for an someone with experience in trading and indicators that has worked on similar strategy indicators. it already wins lots of very good trades im looking to tighten up on uneccesary trades it may send to clean it up as i currently am testing it out running to signal channel and want it the best /

Informações sobre o projeto

Orçamento
30+ USD