Orders Execution
Indicators Used
0
Views
0
Downloads
0
Favorites
Profitability Reports
AUD/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%
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%
mx
//------------------------------------------------------------------------------
// mx |
//------------------------------------------------------------------------------
extern double SL=10;
extern double TP=10;
extern double TS=5;
int MAGIC=12345;
double Lots=1.0,diClose0,sMM,fMM;
//------------------------------------------------------------------------------
int init() {return(0);}
int deinit(){return(0);}
//------------------------------------------------------------------------------
int start(){
//
diClose0=iClose(NULL,PERIOD_M15,0);
fMM=iMA(NULL,PERIOD_M15,5,0,3,2,0);
sMM=iMA(NULL,PERIOD_M15,7,0,3,2,0);
//
if(OrdersTotal()<1){
if(diClose0<sMM){
OrderSend(Symbol(),OP_BUY,Lots,Ask,2,Ask-Point*SL,Ask+Point*TP,"",MAGIC,0,CLR_NONE);
}
if(fMM<diClose0){
OrderSend(Symbol(),OP_SELL,Lots,Bid,2,Bid+Point*SL,Bid-Point*TP,"",MAGIC,0,CLR_NONE);
}
}
TrailStop(TS);
return(0);
}
//------------------------------------------------------------------------------
void TrailStop(double TS_){
bool OM;
int Ticket;
double OOP,OTP;
int TotalOrders=OrdersTotal();
for(int n=OrdersTotal()-1;n>=0;n--){
if(OrderSelect(n,SELECT_BY_POS,MODE_TRADES)){
OOP=OrderOpenPrice();
OTP=OrderTakeProfit();
if(0<TS_ && OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC){
if(OrderType()==OP_BUY){
if(Point*TS_ < Bid-OrderOpenPrice()){
if(OrderStopLoss() < Bid-Point*TS_){
OrderModify(OrderTicket(),OOP,Bid-Point*TS_,OTP,0,CLR_NONE);
return(0);
}
}
}
if(OrderType()==OP_SELL){
if(Point*TS_ < (OrderOpenPrice()-Ask)){
if((Ask+Point*TS_ < OrderStopLoss()) || (OrderStopLoss()==0)){
OrderModify(OrderTicket(),OOP,Ask+Point*TS_,OTP,0,CLR_NONE);
return(0);
}
}
}
}else{
Print("Error : ",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
---