Creating A Trading Bot

Specification

//+------------------------------------------------------------------+
//|                                                  Emmanuels Bot  |
//|                                       Copyright © 2023 Emmanuel  |
//|                                          https://www.example.com |
//+------------------------------------------------------------------+

//|----------------------------------------------------|
//|            Trading Strategy Parameters             |
//|----------------------------------------------------|
input double Key_Value = 2.0;      // Key Value to adjust sensitivity
input int ATR_Period = 10;         // ATR Period
input double Lot_Size = 0.05;      // Lot Size for orders
input int Take_Profit = 20;        // Take Profit in pips

//|----------------------------------------------------|
//|                      Indicator                     |
//|----------------------------------------------------|
double xATRTrailingStop;           // Trailing Stop value

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {
   double atr = iATR(_Symbol, _Period, ATR_Period, 0);  // ATR value
   double nLoss = Key_Value * atr;                     // Dynamic Loss value
   double stopLoss = 0;                                // Stop Loss value

// Calculate the Trailing Stop
   if(Close[1] < xATRTrailingStop && Close[0] > xATRTrailingStop))
     {
      xATRTrailingStop = MathMax(xATRTrailingStop[1], Close[0] - nLoss);
     }
   else
      if(Close[1] > xATRTrailingStop && Close[0] < xATRTrailingStop)
        {
         xATRTrailingStop = MathMin(xATRTrailingStop[1], Close[0] + nLoss);
        }
      else
        {
         if(Close[0] > xATRTrailingStop)
           {
            xATRTrailingStop = Close[0] - nLoss;
           }
         else
           {
            xATRTrailingStop = Close[0] + nLoss;
           }
        }

// Check for entry signal
   if(Close[1] < xATRTrailingStop && Close[0] > xATRTrailingStop)
     {
      if(PositionsTotal() == 0)
        {
         // Open Buy Order
         double stopLoss = xATRTrailingStop - nLoss;
         double takeProfit = xATRTrailingStop + Take_Profit * _Point;
         OrderSend(_Symbol, OP_BUY, Lot_Size, Ask, 3, stopLoss, takeProfit, "Buy Order", 0, 0, CLR_GREEN);
        }
     }
   else
      if(Close[1] > xATRTrailingStop && Close[0] < xATRTrailingStop)
        {
         if(PositionsTotal() == 0)
           {
            // Open Sell Order
            double stopLoss = xATRTrailingStop + nLoss;
            double takeProfit = xATRTrailingStop - Take_Profit * _Point;
            OrderSend(_Symbol, OP_SELL, Lot_Size, Bid, 3, stopLoss, takeProfit, "Sell Order", 0, 0, CLR_RED);
           }
        }

// Check for exit signal
   if(PositionsTotal() > 0)
     {
      if(Close[1] > xATRTrailingStop && Close[0] < xATRTrailingStop && PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)
        {
         // Close Buy Order
         OrderClose(PositionGetTicket(0), Lot_Size, Bid, 3, CLR_GREEN);
        }
      //+------------------------------------------------------------------+

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

I NEED TO DEBUG THIS CODE 

Responded

1
Developer 1
Rating
(188)
Projects
308
15%
Arbitration
20
40% / 35%
Overdue
16
5%
Loaded
2
Developer 2
Rating
(568)
Projects
641
41%
Arbitration
21
57% / 29%
Overdue
47
7%
Working
3
Developer 3
Rating
(3)
Projects
3
33%
Arbitration
0
Overdue
0
Free
4
Developer 4
Rating
(57)
Projects
72
22%
Arbitration
13
46% / 15%
Overdue
5
7%
Free
5
Developer 5
Rating
(68)
Projects
79
9%
Arbitration
34
9% / 53%
Overdue
6
8%
Loaded
6
Developer 6
Rating
(1128)
Projects
1430
62%
Arbitration
21
57% / 10%
Overdue
43
3%
Free
7
Developer 7
Rating
(12)
Projects
19
26%
Arbitration
4
25% / 25%
Overdue
1
5%
Free
8
Developer 8
Rating
(466)
Projects
698
56%
Arbitration
43
30% / 33%
Overdue
113
16%
Working
9
Developer 9
Rating
(454)
Projects
513
33%
Arbitration
26
38% / 46%
Overdue
7
1%
Loaded
10
Developer 10
Rating
(3)
Projects
4
0%
Arbitration
0
Overdue
1
25%
Free
Similar orders
I am looking for an experienced Forex trading expert to help me configure, set up, and run a fully automated trading account. I am new to Forex trading and am eager to learn, so I am seeking someone who can not only set up the account but also provide guidance and education throughout the process
This Indicator is for the 15minutes timeframe but it should be able to work on higher timeframes and with any currency pairs. I want an indicator that draws two horizontal lines - One from the Highest High, the other from the Lowest Low. The lines start from the start of a new Trading day and ends at 04:00 am. So the indicator draws the line from the highest high between time 0 and 4am AND the line from the lowest
I have an EA that works with GRID, very simple strategy. THE JOB - This current EA is not closing both sides when TP is reached so would like to make this function work. The strategy : The Expert will start and generate a position of buy\sell at the same time when added to chart. The frist and last positions are considered scalping positions with a smaller TP just for the purpose of generating IB comisisons. After
I would like to find someone who has already created a trading robot before. Im also looking for someone who can creat a bot that goes with time and structure
hi. I hv a strategy on tradingview need to convert to MT4/MT5 expert advisor for algo trading. would like to add some tradingview strategy setting to the EA(not included in my tradingview code): recalculate after order is filled, order size: xx% of equity
Hello great developer i need a great developer that can help me to do the modification on Ninjatrader https://forum.ninjatrader.com/forum/ninjatrader-7/general-development/44785-real-time-data-feed-from-excel-sheet Need a simple tool to connect rt data from excel to Ninjatrader- Already a free tool available which extracts data from trading software called- Nest Trader - to Ninjatrader- Its possible to modify it to
Hello I would like to replicate ThinkTrader desktop version indicators to be used in MT4 . The indicators are 1) Trendrisk Trend and 2) Supertrend. These indicators will paint the candlestick of the chart. thanks
Mt4 EA Copy trades from octafx copytrading master trader trades 1-i need a bot which will copy trades from Octafx Copytrading Master Trader trades to Metatrader 4 account. 2-bot will copy exactly same trade with same lotsize 3-Bot should open exactly same time when master open and close exactly same time when master close 4-provide complete source code Guide Completely how to Run*
EA indicador Velas 30 - 50 USD
Necesito crear un EA basado en un indicador que da señal de entrada y que tenga los siguientes parametros 1. Entrar Buy o Sell en la siguiente vela de la señal dependiendo la Flecha 2. El TP para BUY sera apenas cierre en vela verde sin importar los pips que saque de ganancias puede ser que sea 1 pip o 10 o incluso salir en perdida, no importa 2. El TP para Sell sera apenas cierre en vela roja sin importar los pips
Forex trading market opening an account for the first time, modify you system of forex , always there for everyone,you are all welcome and for info on all platforms @ lil_johnny254 there to serve you

Project information

Budget
30+ USD
VAT (19%): 5.7 USD
Total: 35.7 USD
For the developer
27 USD