Author: newdigital
Profit factor:
0.70
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategy
Indicators Used
Moving average indicatorParabolic Stop and Reverse systemMACD Histogram
10 Views
0 Downloads
0 Favorites
Scalp_net
//+------------------------------------------------------------------+
//| This EA should be good for eurusd with default setting.          |
//|                For M1 timeframe only                             |
//|                                                                  |
//|                                                                  |
//|                                                                  |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "newdigital"
#property link      "http://www.forex-tsd.com"

extern int MagicNumber = 0;
extern bool EachTickMode = False;
extern double Lots = 0.1;
extern int Slippage = 3;
extern bool StopLossMode = True;
extern int StopLoss = 100;
extern bool TakeProfitMode = True;
extern int TakeProfit = 100;
extern bool TrailingStopMode = True;
extern int TrailingStop = 30;

#define SIGNAL_NONE 0
#define SIGNAL_BUY   1
#define SIGNAL_SELL  2
#define SIGNAL_CLOSEBUY 3
#define SIGNAL_CLOSESELL 4

int BarCount;
int Current;
bool TickCheck = False;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init() {
   BarCount = Bars;

   if (EachTickMode) Current = 0; else Current = 1;

   return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit() {
   return(0);
}
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start() {
   int Order = SIGNAL_NONE;
   int Total, Ticket;
   double StopLossLevel, TakeProfitLevel;



   if (EachTickMode && Bars != BarCount) EachTickMode = False;
   Total = OrdersTotal();
   Order = SIGNAL_NONE;
   
   //+------------------------------------------------------------------+
   //| Signal Begin                                                     |
   //+------------------------------------------------------------------+

      double Buy1_1 = iMA(NULL, 0, 55, 0, MODE_EMA, PRICE_CLOSE, Current + 1);
      double Buy1_2 = iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, Current + 1);
      double Buy2_1 = iMA(NULL, 0, 55, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
      double Buy2_2 = iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
      double Buy3_1 = iSAR(NULL, 0, 0.005, 0.05, Current + 1);
      double Buy3_2 = iSAR(NULL, 0, 0.005, 0.05, Current + 0);
      double Buy4_1 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, Current + 1);
      double Buy4_2 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, Current + 0);
      double Sell1_1 = iMA(NULL, 0, 55, 0, MODE_EMA, PRICE_CLOSE, Current + 1);
      double Sell1_2 = iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, Current + 1);
      double Sell2_1 = iMA(NULL, 0, 55, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
      double Sell2_2 = iMA(NULL, 0, 200, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
      double Sell3_1 = iSAR(NULL, 0, 0.005, 0.05, Current + 1);
      double Sell3_2 = iSAR(NULL, 0, 0.005, 0.05, Current + 0);
      double Sell4_1 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, Current + 1);
      double Sell4_2 = iMACD(NULL, 0, 12, 26, 9, PRICE_CLOSE, MODE_SIGNAL, Current + 0);

      if (Buy1_1 < Buy1_2 && Buy2_1 >= Buy2_2 && Buy3_1 < Buy3_2 && Buy4_1 < Buy4_2) Order = SIGNAL_BUY;
      if (Sell1_1 > Sell1_2 && Sell2_1 <= Sell2_2 && Sell3_1 > Sell3_2 && Sell4_1 > Sell4_2) Order = SIGNAL_SELL;

   //+------------------------------------------------------------------+
   //| Signal End                                                       |
   //+------------------------------------------------------------------+

   //Buy
   if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
      if(Total < 1) {
         //Check free margin
         if (AccountFreeMargin() < (1000 * Lots)) {
            Print("We have no money. Free Margin = ", AccountFreeMargin());
            return(0);
         }

         StopLossLevel = Ask - StopLoss * Point;
         TakeProfitLevel = Ask + TakeProfit * Point;
         Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
         if(Ticket > 0) {
            if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice()); else Print("Error opening BUY order : ", GetLastError());
         }
         if (EachTickMode) TickCheck = True;
         if (!EachTickMode) BarCount = Bars;
         return(0);
      }
   }

   //Sell
   if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
      if(Total < 1) {
         //Check free margin
         if (AccountFreeMargin() < (1000 * Lots)) {
            Print("We have no money. Free Margin = ", AccountFreeMargin());
            return(0);
         }
         StopLossLevel = Bid + StopLoss * Point;
         TakeProfitLevel = Bid - TakeProfit * Point;
         Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
         if(Ticket > 0) {
            if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice()); else Print("Error opening SELL order : ", GetLastError());
         }
         if (EachTickMode) TickCheck = True;
         if (!EachTickMode) BarCount = Bars;
         return(0);
      }
   }

   //Check position
   for (int i = 0; i < Total; i ++) {
      OrderSelect(0, SELECT_BY_POS, MODE_TRADES);
      if(OrderType() <= OP_SELL &&  OrderSymbol() == Symbol()) {
         if(OrderType() == OP_BUY) {
            //Close
            if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
               OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);
               if (EachTickMode) TickCheck = True;
               if (!EachTickMode) BarCount = Bars;
               return(0);
            }
            //Trailing stop
            if(TrailingStopMode && TrailingStop > 0) {                 
               if(Bid - OrderOpenPrice() > Point * TrailingStop) {
                  if(OrderStopLoss() < Bid - Point * TrailingStop) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
                     if (!EachTickMode) BarCount = Bars;
                     return(0);
                  }
               }
            }
         } else {
            //Close
            if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
               OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, DarkOrange);
               if (EachTickMode) TickCheck = True;
               if (!EachTickMode) BarCount = Bars;
               return(0);
            }
            //Trailing stop
            if(TrailingStopMode && TrailingStop > 0) {                 
               if((OrderOpenPrice() - Ask) > (Point * TrailingStop)) {
                  if((OrderStopLoss() > (Ask + Point * TrailingStop)) || (OrderStopLoss() == 0)) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);
                     if (!EachTickMode) BarCount = Bars;
                     return(0);
                  }
               }
            }
         }
      }
   }

   if (!EachTickMode) BarCount = Bars;

   return(0);
}
//+------------------------------------------------------------------+

Profitability Reports

USD/JPY Jul 2025 - Sep 2025
0.97
Total Trades 7
Won Trades 4
Lost trades 3
Win Rate 57.14 %
Expected payoff -0.08
Gross Profit 19.69
Gross Loss -20.26
Total Net Profit -0.57
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.63
Total Trades 9
Won Trades 5
Lost trades 4
Win Rate 55.56 %
Expected payoff -2.05
Gross Profit 31.61
Gross Loss -50.03
Total Net Profit -18.42
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.00
Total Trades 4
Won Trades 4
Lost trades 0
Win Rate 100.00 %
Expected payoff 1.29
Gross Profit 5.16
Gross Loss 0.00
Total Net Profit 5.16
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.00
Total Trades 4
Won Trades 4
Lost trades 0
Win Rate 100.00 %
Expected payoff 4.88
Gross Profit 19.50
Gross Loss 0.00
Total Net Profit 19.50
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
4.04
Total Trades 7
Won Trades 6
Lost trades 1
Win Rate 85.71 %
Expected payoff 4.34
Gross Profit 40.40
Gross Loss -10.00
Total Net Profit 30.40
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.50
Total Trades 3
Won Trades 1
Lost trades 2
Win Rate 33.33 %
Expected payoff -2.41
Gross Profit 7.23
Gross Loss -14.46
Total Net Profit -7.23
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
1.66
Total Trades 4
Won Trades 3
Lost trades 1
Win Rate 75.00 %
Expected payoff 1.09
Gross Profit 10.96
Gross Loss -6.60
Total Net Profit 4.36
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.45
Total Trades 7
Won Trades 3
Lost trades 4
Win Rate 42.86 %
Expected payoff -3.11
Gross Profit 18.20
Gross Loss -40.00
Total Net Profit -21.80
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.00
Total Trades 5
Won Trades 5
Lost trades 0
Win Rate 100.00 %
Expected payoff 2.62
Gross Profit 13.10
Gross Loss 0.00
Total Net Profit 13.10
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
0.61
Total Trades 12
Won Trades 6
Lost trades 6
Win Rate 50.00 %
Expected payoff -1.32
Gross Profit 25.09
Gross Loss -40.97
Total Net Profit -15.88
-100%
-50%
0%
50%
100%

Comments