Orders Execution
0
Views
0
Downloads
0
Favorites
Profitability Reports
AUD/USD
Oct 2024 - Jan 2025
0.00 %
Total Trades
341
Won Trades
0
Lost trades
0
Win Rate
0.00 %
Expected payoff
-28.87
Gross Profit
0.00
Gross Loss
-9845.00
Total Net Profit
-9845.00
-100%
-50%
0%
50%
100%
GBP/USD
Oct 2024 - Jan 2025
3.00 %
Total Trades
649
Won Trades
2
Lost trades
647
Win Rate
0.00 %
Expected payoff
-14.84
Gross Profit
301.00
Gross Loss
-9935.00
Total Net Profit
-9634.00
-100%
-50%
0%
50%
100%
NZD/USD
Oct 2024 - Jan 2025
4.00 %
Total Trades
272
Won Trades
2
Lost trades
270
Win Rate
0.01 %
Expected payoff
-36.22
Gross Profit
400.00
Gross Loss
-10251.00
Total Net Profit
-9851.00
-100%
-50%
0%
50%
100%
EJ_4H v1.0
//+------------------------------------------------------------------+
//| EJ_4H.mq4 |
//| Chinplant |
//| version 1.0 |
//| http://www.forex-tsd.com |
//+------------------------------------------------------------------+
#property copyright "Chinplant"
//---- input parameters
extern double Lots=1;
extern double TakeProfit=1000;
extern double Stoploss=0;
extern int Slippage=0;
extern bool accum=false; //allow accumulation of same order types
int CurrentBarOpentime;
int majic=1234567890;
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
//LotCalc(1);
int cnt, ticket, total;
if(Bars<100)
{
Print("bars less than 100");
return(0);
}
if(TakeProfit<10)
{
Print("TakeProfit less than 10");
return(0); // check TakeProfit
}
double BuySignal=0;
double SellSignal=0;
double CurrBuySignal=0;
double CurrSellSignal=0;
bool Buy_Order_Exist=false;
bool Sell_Order_Exist=false;
BuySignal=iCustom(NULL,0,"EJ_Signal",3,300,1,1);
SellSignal=iCustom(NULL,0,"EJ_Signal",3,300,0,1);
CurrBuySignal=iCustom(NULL,0,"EJ_Signal",3,300,1,0);
CurrSellSignal=iCustom(NULL,0,"EJ_Signal",3,300,0,0);
total = OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS);
// OrderPrint();
if(OrderMagicNumber()==majic && OrderSymbol()==Symbol())
{
if(OrderType()==OP_BUY) // long position is opened
{
if (!accum) Buy_Order_Exist=true; // some orders already opened by this EA
// should it be closed?
if(CurrSellSignal>0)
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
return(0); // exit
}
// check for trailing stop
}
else // go to short position
{
// should it be closed?
if (!accum) Sell_Order_Exist=true; // some orders already opened by this EA
if(CurrBuySignal>0)
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
return(0); // exit
}
// check for trailing stop
}
}
}
if (CurrentBarOpentime != Time[0] && (SellSignal>0 || BuySignal>0))
{
if (BuySignal>0 && !Buy_Order_Exist)
{
if (Stoploss!=0)
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Ask-Stoploss*Point,Ask+TakeProfit*Point,"EJ_4H",majic,0,Green);
else
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,Ask+TakeProfit*Point,"EJ_4H",majic,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
}
if (SellSignal>0 && !Sell_Order_Exist)
{
if (Stoploss!=0)
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Ask+Stoploss*Point,Bid-TakeProfit*Point,"EJ_4H",majic,0,Red);
else
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,Bid-TakeProfit*Point,"EJ_4H",majic,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---