No Indicator Ea

Author: docchiro
Price Data Components
Series array that contains open prices of each barSeries array that contains close prices for each bar
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategyIt automatically opens orders when conditions are reached
Miscellaneous
It sends emails
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
40.00 %
Total Trades 502
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -0.21
Gross Profit 71.22
Gross Loss -177.00
Total Net Profit -105.78
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
51.00 %
Total Trades 564
Won Trades 114
Lost trades 450
Win Rate 0.20 %
Expected payoff -0.18
Gross Profit 109.03
Gross Loss -212.19
Total Net Profit -103.16
-100%
-50%
0%
50%
100%
No Indicator Ea
//+------------------------------------------------------------------+
//| if you found this ea usefull please donate into my paypal acc    

//  |                                                                  |
//+------------------- DO NOT REMOVE THIS HEADER --------------------+

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

#property copyright "docchiro"
#property link      "rbruckner@gmail.com"

extern int MagicNumber = 0;
extern bool SignalMail = False;
extern bool EachTickMode = True;
extern double Lots = 0.01;
extern int Slippage = 3;
extern bool UseStopLoss = True;
extern int StopLoss = 50;
extern bool UseTakeProfit = True;
extern int TakeProfit = 200;
extern bool UseTrailingStop = false;
extern int TrailingStop = 50;

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) TickCheck = False;
   Total = OrdersTotal();
   Order = SIGNAL_NONE;

   //+------------------------------------------------------------------+
   //| Variable Begin                                                   |
   //+------------------------------------------------------------------+

double Var1 = iOpen(NULL, 0, Current + 1);
double Var2 = iOpen(NULL, 0, Current + 2);
double Var5 = iOpen(NULL, 0, Current + 0);
double Var3 = iClose(NULL, 0, Current + 1);
double Var4 = iClose(NULL, 0, Current + 2); 
string V1;
string V2;
string V3;
string V4;
string V5;
string V1V3;
string V2V4;



double Buy1_1 =  Var4  -  Var2 ;
double Buy1_2 = 0;
double Buy2_1 =  Var3  -  Var1 ;
double Buy2_2 = 0;

double Sell1_1 =  Var4  -  Var1 ;
double Sell1_2 = 0;
double Sell2_1 =  Var3  -  Var1 ;
double Sell2_2 = 0;

double CloseBuy1_1 =  Var3  -  Var1 ;
double CloseBuy1_2 = 0;

double CloseSell1_1 =  Var3  -  Var1 ;
double CloseSell1_2 = 0;

double Cl1=White;
double Cl2=White;


V1 = Var1;
V2 = Var2;
V3 = Var3;
V4 = Var4;
V5 = Var5;
V1V3 = Var1-Var3; 
V2V4 = Var2-Var4;
if(Var1>Var3)
   Cl1 = Blue;
if(Var1<Var3)
   Cl1 = Red;
   
if(Var2>Var4)
   Cl2 = Blue;
if(Var2<Var4)
   Cl2 = Red;
 
 
// display
 
   
   ObjectCreate("Header1",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("Header1",OBJPROP_XDISTANCE,160);
   ObjectSet("Header1",OBJPROP_YDISTANCE,100);
   ObjectSetText("Header1","Open             Close            Diff",10,"Arial",White);
  
   ObjectCreate("Header2",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("Header2",OBJPROP_XDISTANCE,80);
   ObjectSet("Header2",OBJPROP_YDISTANCE,120);
   ObjectSetText("Header2","Current",10,"Arial",White);
   
   ObjectCreate("Header3",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("Header3",OBJPROP_XDISTANCE,80);
   ObjectSet("Header3",OBJPROP_YDISTANCE,140);
   ObjectSetText("Header3","Prev Bar",10,"Arial",White);
   
   ObjectCreate("Header4",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("Header4",OBJPROP_XDISTANCE,80);
   ObjectSet("Header4",OBJPROP_YDISTANCE,160);
   ObjectSetText("Header4","2 Bars Back",10,"Arial",White);
  

   ObjectDelete("OPC1");
   ObjectCreate("OPC1",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("OPC1",OBJPROP_XDISTANCE,160);
   ObjectSet("OPC1",OBJPROP_YDISTANCE,120);
   ObjectSetText("OPC1",V5,10,"Arial",White);
   
   
   
     ObjectDelete("OPB1");
   ObjectCreate("OPB1",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("OPB1",OBJPROP_XDISTANCE,160);
   ObjectSet("OPB1",OBJPROP_YDISTANCE,140);
   ObjectSetText("OPB1",V1,10,"Arial",Cl1);
   
   ObjectDelete("CLB1");
   ObjectCreate("CLB1",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("CLB1",OBJPROP_XDISTANCE,240);
   ObjectSet("CLB1",OBJPROP_YDISTANCE,140);
   ObjectSetText("CLB1",V3,10,"Arial",Cl1);
   
    ObjectDelete("PrevDiff");
   ObjectCreate("PrevDiff",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("PrevDiff",OBJPROP_XDISTANCE,320);
   ObjectSet("PrevDiff",OBJPROP_YDISTANCE,140);
   ObjectSetText("PrevDiff",V1V3,10,"Arial",Cl1); 
   
   ObjectDelete("OPB2");
   ObjectCreate("OPB2",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("OPB2",OBJPROP_XDISTANCE,160);
   ObjectSet("OPB2",OBJPROP_YDISTANCE,160);
   ObjectSetText("OPB2",V2,10,"Arial",Cl2);
   
   ObjectDelete("CLB2");
   ObjectCreate("CLB2",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("CLB2",OBJPROP_XDISTANCE,240);
   ObjectSet("CLB2",OBJPROP_YDISTANCE,160);
   ObjectSetText("CLB2",V4,10,"Arial",Cl2);
   
    ObjectDelete("2BBDiff");
   ObjectCreate("2BBDiff",OBJ_LABEL,0,0,0,0,0);
   ObjectSet("2BBDiff",OBJPROP_XDISTANCE,320);
   ObjectSet("2BBDiff",OBJPROP_YDISTANCE,160);
   ObjectSetText("2BBDiff",V2V4,10,"Arial",Cl2);
   
  

  
   //+------------------------------------------------------------------+
   //| Variable End                                                     |
   //+------------------------------------------------------------------+

   //Check position
   bool IsTrade = False;

   for (int i = 0; i < Total; i ++) {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if(OrderType() <= OP_SELL &&  OrderSymbol() == Symbol()) {
         IsTrade = True;
         if(OrderType() == OP_BUY) {
            //Close

            //+------------------------------------------------------------------+
            //| Signal Begin(Exit Buy)                                           |
            //+------------------------------------------------------------------+

                     if (CloseBuy1_1 < CloseBuy1_2  ) Order = SIGNAL_CLOSEBUY;


            //+------------------------------------------------------------------+
            //| Signal End(Exit Buy)                                             |
            //+------------------------------------------------------------------+

            if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
               OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid,4), Slippage, MediumSeaGreen);
               if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Bid,4), Digits) + " Close Buy");
               if (!EachTickMode) BarCount = Bars;
               IsTrade = False;
               Order = SIGNAL_SELL;
               continue;
            }
            //Trailing stop
            if(UseTrailingStop && TrailingStop > 0) {                 
               if(NormalizeDouble(Bid,4) - OrderOpenPrice() > Point * TrailingStop) {
                  if(OrderStopLoss() < NormalizeDouble(Bid,4) - Point * TrailingStop) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Bid,4) - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
                     if (!EachTickMode) BarCount = Bars;
                     continue;  
                  }
               } 
            }
         } else {
            //Close

            //+------------------------------------------------------------------+
            //| Signal Begin(Exit Sell)                                          |
            //+------------------------------------------------------------------+

                     if (CloseSell1_1 > CloseSell1_2) Order = SIGNAL_CLOSESELL;


            //+------------------------------------------------------------------+
            //| Signal End(Exit Sell)                                            |
            //+------------------------------------------------------------------+

            if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
               OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask,4), Slippage, DarkOrange);
               if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Ask,4), Digits) + " Close Sell");
               if (!EachTickMode) BarCount = Bars;
               IsTrade = False;
               Order = SIGNAL_BUY;
               continue;
            }
            //Trailing stop
            if(UseTrailingStop && TrailingStop > 0) {                 
               if((OrderOpenPrice() - NormalizeDouble(Ask,4)) > (Point * TrailingStop)) {
                  if((OrderStopLoss() > (NormalizeDouble(Ask,4) + Point * TrailingStop)) || (OrderStopLoss() == 0)) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Ask,4) + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);
                     if (!EachTickMode) BarCount = Bars;
                     continue;
                  }
               }
            }
         }
      } 
   }

   //+------------------------------------------------------------------+
   //| Signal Begin(Entry)                                              |
   //+------------------------------------------------------------------+

   if (Buy1_1 < Buy1_2 && Buy2_1 > Buy2_2 && (Var3-Var1 > Var4-Var2) && (Var5 > Var3)) Order = SIGNAL_BUY;

   if (Sell1_1 > Sell1_2 && Sell2_1 < Sell2_2 && (Var3-Var1 > Var4-Var2) && (Var5 < Var3)) Order = SIGNAL_SELL;


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

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

         if (UseStopLoss) StopLossLevel = NormalizeDouble(Ask,4) - StopLoss * Point; else StopLossLevel = 0.0;
         if (UseTakeProfit) TakeProfitLevel = NormalizeDouble(Ask,4) + TakeProfit * Point; else TakeProfitLevel = 0.0;

         Ticket = OrderSend(Symbol(), OP_BUY, Lots, NormalizeDouble(Ask,4), Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
         if(Ticket > 0) {
            if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
				Print("BUY order opened : ", OrderOpenPrice());
                if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Ask,4), Digits) + " Open Buy");
			} 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(!IsTrade) {
         //Check free margin
         if (AccountFreeMargin() < (1000 * Lots)) {
            Print("We have no money. Free Margin = ", AccountFreeMargin());
            return(0);
         }

         if (UseStopLoss) StopLossLevel = NormalizeDouble(Bid,4) + StopLoss * Point; else StopLossLevel = 0.0;
         if (UseTakeProfit) TakeProfitLevel = NormalizeDouble(Bid,4) - TakeProfit * Point; else TakeProfitLevel = 0.0;

         Ticket = OrderSend(Symbol(), OP_SELL, Lots, NormalizeDouble(Bid,4), Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
         if(Ticket > 0) {
            if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
				Print("SELL order opened : ", OrderOpenPrice());
                if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(NormalizeDouble(Bid,4), Digits) + " Open Sell");
			} else {
				Print("Error opening SELL order : ", GetLastError());
			}
         }
         if (EachTickMode) TickCheck = True;
         if (!EachTickMode) BarCount = Bars;
         return(0);
      }
   }

   if (!EachTickMode) BarCount = Bars;

   return(0);
}




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

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---