Orders Execution
Indicators Used
0
Views
0
Downloads
0
Favorites
Profitability Reports
GBP/CAD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
GBP/USD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
_____
extern double TakeProfit = 15,StopLoss=15;
extern double pp=2.5,pp1=3.5,pp2=3.5,pp3=4.5, mm=3.5, mm1=3.5, mm2=4.5,SL=15;
double close;
int start()
{
int cnt, ticket;
int mag;
if (Symbol()=="EURUSD") mag=1;
if (Symbol()=="GBPUSD") mag=2;
if (Symbol()=="USDCHF") mag=3;
if (Symbol()=="USDJPY") mag=4;
double Lots;
if (Symbol()=="EURUSD" || Symbol()=="GBPUSD") Lots=(MathCeil(AccountBalance()/Close[0]*Point*100)-1)/10;
if (Symbol()=="USDCHF") Lots=(MathCeil(AccountBalance()*Point*100)-1)/10;
if (Symbol()=="USDJPY") Lots=(MathCeil(AccountBalance()*Point)-1)/10;
if (Lots>100) Lots=100;
if (Lots<0.1) Lots=0.1;
double bc=((iBullsPower(NULL, 0, 1,PRICE_CLOSE,0)+iBearsPower(NULL,0, 1,PRICE_CLOSE,0))/Point);
double s,b;
if ((Close[0]-Open[1])/Point > pp3)
{s=1;
Print("sell pp3");}
if ((Close[0]-Open[1])/Point <-pp3)
{b=1;
Print("buy pp3");}
if ((Close[0]-Open[0])/Point > pp2)
{s=1;
Print("sell pp2");}
if ((Close[0]-Open[0])/Point <-pp2)
{b=1;
Print("buy pp2");}
if ((Close[0]-Close[1])/Point > pp1)
{s=1;
Print("sell pp1");}
if ((Close[0]-Close[1])/Point <-pp1)
{b=1;
Print("buy pp1");}
if (bc > pp)
{b=1;
Print("buy pp");}
if (bc < -pp)
{s=1;
Print("sell pp");}
Print(Day(),"/",Month()," ",Hour(),":",Minute(),":",Seconds()," Bal=",AccountBalance()," eq=",AccountEquity()," ",Symbol(),"=",Close[0]," BC=",bc," cl1=",(Close[0]-Close[1])/Point," c=",close," L=",Lots);
Comment(Hour(),":",Minute(),":",Seconds()," Bal=",AccountBalance()," eq=",AccountEquity()," ",Symbol(),"=",Close[0]," BC=",bc," cl1=",(Close[0]-Close[1])/Point," c=",close," L=",Lots);
for(cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()==OP_BUY && OrderMagicNumber()==mag ) close=OrderOpenPrice()-SL*Point;
if(OrderType()==OP_SELL && OrderMagicNumber()==mag) close=OrderOpenPrice()+SL*Point;
}
//---------------------------------------------------------------
if (OrdersTotal()>0)
{
for(cnt=0;cnt<OrdersTotal();cnt++)
{
if (OrderMagicNumber()==mag )
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()==OP_BUY )
{
if(bc<-mm || (Close[0]-Open[0])/Point>mm2)
{
Print("bc_BUY");
OrderClose(OrderTicket(),OrderLots(),Bid,0,Red);
}
}
if(OrderType()==OP_SELL)
{
if(bc>mm || (Close[0]-Open[0])/Point<-mm2)
{Print("bc_SELL");
OrderClose(OrderTicket(),OrderLots(),Ask,0,Aqua);
}
}
if(OrderType()==OP_BUY )
{
if(bc<-mm || (Close[0]-Close[1])/Point>mm1)
{
Print("bc_BUY");
OrderClose(OrderTicket(),OrderLots(),Bid,0,Red);
}
}
if(OrderType()==OP_SELL)
{
if(bc>mm || (Close[0]-Close[1])/Point<-mm1)
{Print("bc_SELL");
OrderClose(OrderTicket(),OrderLots(),Ask,0,Aqua);
}
}
if(OrderType()==OP_BUY)
{
if(Bid<close)
{Print("close_BUY");
OrderClose(OrderTicket(),OrderLots(),Bid,0,Red);
}
}
if(OrderType()==OP_SELL)
{
if(Ask>close )
{
OrderClose(OrderTicket(),OrderLots(),Ask,0,Aqua);
Print("close_SELL");
}
}
if(OrderType()==OP_BUY)
{
if(AccountEquity()-AccountBalance() > 0)
{
Print("+_BUY");
OrderClose(OrderTicket(),OrderLots(),Bid,0,Red);
}
}
if(OrderType()==OP_SELL)
{
if(AccountEquity()-AccountBalance() > 0)
{
Print("+_SELL");
OrderClose(OrderTicket(),OrderLots(),Ask,0,Aqua);
}
}
}
}
}
//-------------------------------------------------------------------------------
if(OrdersTotal()<1)
{
if(b==1 && (Ask-Bid)/Point<3)
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"buy",mag,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
close=Ask-SL*Point;
}
else Print("Error opening BUY order : ",GetLastError());
}
if(s==1 && (Ask-Bid)/Point<3)
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,0,Bid+StopLoss*Point,Bid-TakeProfit*Point,"sell",mag,0,Aqua);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
close=Bid+SL*Point;
}
else Print("Error opening SELL order : ",GetLastError());
}
}
}
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
---