Creating A Trading Bot

İş Gereklilikleri

//+------------------------------------------------------------------+
//|                                                  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 

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(188)
Projeler
308
15%
Arabuluculuk
20
40% / 35%
Süresi dolmuş
16
5%
Yüklendi
2
Geliştirici 2
Derecelendirme
(568)
Projeler
641
41%
Arabuluculuk
21
57% / 29%
Süresi dolmuş
47
7%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(3)
Projeler
3
33%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(57)
Projeler
72
22%
Arabuluculuk
13
46% / 15%
Süresi dolmuş
5
7%
Serbest
5
Geliştirici 5
Derecelendirme
(68)
Projeler
79
9%
Arabuluculuk
34
9% / 53%
Süresi dolmuş
6
8%
Yüklendi
6
Geliştirici 6
Derecelendirme
(1128)
Projeler
1430
62%
Arabuluculuk
21
57% / 10%
Süresi dolmuş
43
3%
Serbest
7
Geliştirici 7
Derecelendirme
(12)
Projeler
19
26%
Arabuluculuk
4
25% / 25%
Süresi dolmuş
1
5%
Serbest
8
Geliştirici 8
Derecelendirme
(466)
Projeler
698
56%
Arabuluculuk
43
30% / 33%
Süresi dolmuş
113
16%
Çalışıyor
9
Geliştirici 9
Derecelendirme
(455)
Projeler
514
33%
Arabuluculuk
26
38% / 46%
Süresi dolmuş
7
1%
Yüklendi
10
Geliştirici 10
Derecelendirme
(3)
Projeler
4
0%
Arabuluculuk
0
Süresi dolmuş
1
25%
Serbest
Benzer siparişler
EMA’s Crossing - Scalping Bot Overview: Scalping bot Operating on MT5 Operating on any Market Watch Symbols as selected by user (Forex, Commodities, Indices, Virtual Indices) Operating on any time frame (per chart timeframe selected by user) Strategy: When 2 Moving Averages (EMA’s) cross, bot must open a trade in the direction of the first EMA (first EMA and second EMA will be selected in parameters by the user)
I have a hedging strategy idea I would like coded but it is complicated and advanced, I have two EAs I would like the idea coded to. I would like the coder to be professional and fast. The hedging strategy consists of opening multiple orders mixed of buys & sells. Please be experienced and don't waste my time or yours
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 need a robot that will automatically enter buy and sell positions based on the renko chart. The trend is to be determined on the basis of Elliot Waves. Individual peaks and troughs are determined by the TMA centerband Indicator. The buy position is entered when a higher low appears via the buy signal of the TMA indicator A sell position is entered when a lower high appears via the sell signal of the TMA
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
The idea of the trading system is as follows : market entries are performed when MACD's main and signal lines intersect in the current trend direction . 2. Trend is determined based on the Exponential Moving Average with the specified period (InpMATrendPeriod). If the current EMA value is greater than the previous one, the trend is seen as growing (ema_current > ema_previous). Alternatively, if current EMA is

Proje bilgisi

Bütçe
30+ USD
KDV (19%): 5.7 USD
Toplam: 35.7 USD
Geliştirici için
27 USD