Orders Execution
Indicators Used
0
Views
0
Downloads
0
Favorites
Profitability Reports
AUD/USD
Oct 2024 - Jan 2025
72.00 %
Total Trades
76
Won Trades
0
Lost trades
0
Win Rate
0.00 %
Expected payoff
-2.01
Gross Profit
396.20
Gross Loss
-549.20
Total Net Profit
-153.00
-100%
-50%
0%
50%
100%
GBP/USD
Oct 2024 - Jan 2025
62.00 %
Total Trades
74
Won Trades
27
Lost trades
47
Win Rate
0.36 %
Expected payoff
-2.60
Gross Profit
318.50
Gross Loss
-511.10
Total Net Profit
-192.60
-100%
-50%
0%
50%
100%
MA cross exp_v4
//+------------------------------------------------------------------+
//| Copyright 2006, Malinouski Yury |
//| mailto:panzernik@tut.by |
//| version 4.0 |
//| 01.04.2006 |
//+------------------------------------------------------------------+
// Çà îñíîâó âçÿò ýêñïåðò MA cross.mq4 (àâòîð Alexey42)
// Äîáàâëåíû ñëåäóþùèå ïàðàìåòðû: ma_method, TrailingStop, applied_price
// Ýêñïåðò îòêðûâàåò è çàêðûâàåò ïîçèöèè ïî ôàêòó ïåðåñå÷åíèÿ ñðåäíèõ
// Êòî ñìîæåò ðåàëèçîâàòü âûñòàâëåíèå stop_loss ïî ïàðàáîëèêó?
extern int ma_fast=8; // Ïåðèîä áûñòðîé ÌÀ
extern int ma_slow=21; // Ïåðèîä ìåäëåííîé ÌÀ
extern double ma_method=1;/*MODE_SMA 0 Ïðîñòîå ñêîëüçÿùåå ñðåäíåå
MODE_EMA 1 Ýêñïîíåíöèàëüíîå ñêîëüçÿùåå ñðåäíåå
MODE_SMMA 2 Ñãëàæåííîå ñêîëüçÿùåå ñðåäíåå
MODE_LWMA 3 Ëèíåéíî-âçâåøåííîå ñêîëüçÿùåå ñðåäíåå
*/
extern int stop_loss=110;
extern int take_profit=370;
extern double TrailingStop=110;
extern double applied_price=0;/*PRICE_CLOSE 0 Öåíà çàêðûòèÿ
PRICE_OPEN 1 Öåíà îòêðûòèÿ
PRICE_HIGH 2 Ìàêñèìàëüíàÿ öåíà
PRICE_LOW 3 Ìèíèìàëüíàÿ öåíà
PRICE_MEDIAN 4 Ñðåäíÿÿ öåíà, (high+low)/2
PRICE_TYPICAL 5 Òèïè÷íàÿ öåíà, (high+low+close)/3
PRICE_WEIGHTED 6 Âçâåøåííàÿ öåíà çàêðûòèÿ, (high+low+close+close)/4 */
extern int ma_shifft=0; // Ñäâèã èíäèêàòîðà îòíîñèòåëüíî öåíîâîãî ãðàôèêà
extern double Lots=0.1;
double m1=1;
double m2=1;
double s1=1;
double s2=1;
double b=1;
int cnt=0;
//-------------------------------------------------------------------------------------------------------------
int start()
{
if (b<Bars)
{
m1=iMA(NULL,0,ma_fast, ma_shifft, ma_method, applied_price, 1);
m2=iMA(NULL,0,ma_fast, ma_shifft, ma_method, applied_price, 2);
s1=iMA(NULL,0,ma_slow, ma_shifft, ma_method, applied_price, 1);
s2=iMA(NULL,0,ma_slow, ma_shifft, ma_method, applied_price, 2);
if (OrdersTotal()<1)
{
if
((s2>m2)&&(s1<m1))
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stop_loss*Point,Ask+take_profit*Point,"buy60",1221,0,Blue);
b=Bars;
}
if
((s2<m2)&&(s1>m1))
{
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stop_loss*Point,Bid-take_profit*Point,"sell60",1222,0,Red);
b=Bars;
}
}
for(cnt=0;cnt<4;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && // check for opened position
OrderSymbol()==Symbol()) // check for symbol
{
if(OrderType()==OP_BUY) // long position is opened
{
// should it be closed?
if ((s2<m2)&&(s1>m1)&&(b<Bars))
{b=Bars;
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stop_loss*Point,Bid-take_profit*Point,"sell60",1222,0,Red);
return(0); // exit
}
// check for trailing stop
if(TrailingStop>0)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop)
{
if(OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
return(0);
}
}
}
}
else // go to short position
{
// should it be closed?
if ((s2>m2)&&(s1<m1)&&(b<Bars))
{b=Bars;
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stop_loss*Point,Ask+take_profit*Point,"buy60",1221,0,Blue);
return(0); // exit
}
// check for trailing stop
if(TrailingStop>0)
{
if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
{
if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
//----
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
---