VR---SETKA=3=M

Author: Copyright � 2012, WWW.TRADING-GO.RU .
Profit factor:
0.73
Price Data Components
Series array that contains the highest prices of each barSeries 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 automatically opens orders when conditions are reachedIt can change open orders parameters, due to possible stepping strategy
1 Views
0 Downloads
0 Favorites
VR---SETKA=3=M
//===========================================================================================================================//
// Author VOLDEMAR227 site WWW.TRADING-GO.RU      SKYPE: TRADING-GO          e-mail: TRADING-GO@List.ru
//===========================================================================================================================//
#property copyright "Copyright © 2012, WWW.TRADING-GO.RU ."
#property link      "http://WWW.TRADING-GO.RU"
//WWW.TRADING-GO.RU  full version free
//===========================================================================================================================//
extern string  Comment_1 = "settings";
extern int     Plus= 50;
extern int     TakeProfit = 300;
extern int     Distanciya = 300;
extern double  Lots    = 0.00;
extern double  Percent    = 1;

extern bool    Martin     = true;

extern string  Comment_2 = "signalMA";
extern bool     SignalMA = false;
extern int     PeriodMA1 = 8 ;
extern int     PeriodMA2 = 14 ;

extern string  Comment_3 = "signalRSI";
extern bool    SignalRSI = false;
extern int     PeriodRSI = 14 ;
extern int     up= 50;
extern int     dw= 50;

extern string  Comment_4 = "signalProc";
extern bool    Proc    =true;
extern double  Procent    =1.3;

extern string  Comment_5 = "Monitor";
extern bool    Monitor =  true;
extern int     CORNER = 0;
extern int     Slip=2;
extern int     Magic=1;
int start() 
  {
double Lots_New=0;
 string Symb   =Symbol();               
   double One_Lot=MarketInfo(Symb,MODE_MARGINREQUIRED);
   double Min_Lot=MarketInfo(Symb,MODE_MINLOT);
   double Step   =MarketInfo(Symb,MODE_LOTSTEP);
   double Free   =AccountFreeMargin();        
//--------------------------------------------------------------- 3 --
   if (Lots>0)                               
     {                                        
      double Money=Lots*One_Lot;          
      if(Money<=AccountFreeMargin())         
         Lots_New=Lots;                   
      else                                
         Lots_New=MathFloor(Free/One_Lot/Step)*Step;
     }
//--------------------------------------------------------------- 4 --
   else                                    
     {                                       
      if (Percent > 100)                  
         Percent=100;                    
      if (Percent==0)                
         Lots_New=Min_Lot;                  
      else                      
         Lots_New=MathFloor(Free*Percent/100/One_Lot/Step)*Step;//Ðàñ÷
     }
//--------------------------------------------------------------- 5 --
   if (Lots_New < Min_Lot)                  
      Lots_New=Min_Lot;                  
   if (Lots_New*One_Lot > AccountFreeMargin())
     {                                         
      return(false);                        
     }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
   ObjectCreate("R",OBJ_LABEL,0,0,0);
   ObjectSet("R",OBJPROP_CORNER,2);
   ObjectSet("R",OBJPROP_XDISTANCE,10);
   ObjectSet("R",OBJPROP_YDISTANCE,10);
   ObjectSetText("R","WWW.TRADING-GO.RU  full version free",15,"Arial Black",Red);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
   double opB=2000; double opS=0; double orderProfitbuy=0; double Sum_Profitbuy=0; double orderProfitsel;  double Sum_Profitsel; int orderType;
   double LotB=Lots_New;
   double LotS=Lots_New;
   int total=OrdersTotal();
   int b=0,s=0,n=0;
   for(int i=total-1; i>=0; i--)
     {
      if(OrderSelect(i, SELECT_BY_POS))
        {
         if(OrderSymbol()==Symbol()      )
           {
            n++;
            if(OrderType()==OP_BUY && OrderMagicNumber()==Magic)
              {
               b++;
               LotB=OrderLots();
               double ProfitB=OrderTakeProfit(); double openB=OrderOpenPrice();
               if(openB<opB)
                 {opB=openB;}
              }
            //---------------------------------      
            if(OrderType()==OP_SELL && OrderMagicNumber()==Magic)
              {
               s++;
               LotS=OrderLots();
              double ProfitS=OrderTakeProfit(); double openS=OrderOpenPrice();
               if(openS>opS)
                 {opS=openS;}
              }
           }
        }
     }
   double max = NormalizeDouble(iHigh(Symbol(),1440,0),Digits);
   double min = NormalizeDouble(iLow (Symbol(),1440,0),Digits);
   double opp=NormalizeDouble(iOpen(Symbol(),1440,0),Digits);
   double cl=NormalizeDouble(iClose(Symbol(),1440,0),Digits);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
   double dis   =NormalizeDouble(Distanciya*Point,Digits);
   double spred =NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD)*Point,Digits);
   double  CORR=NormalizeDouble(Plus            *Point,Digits);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//   
int sigup=0;
int sigdw=0;
//WWW.TRADING-GO.RU  full version free
if (SignalMA == true)
{ 
//WWW.TRADING-GO.RU  full version free
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
if (SignalRSI == true)
{
//WWW.TRADING-GO.RU  full version  free
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
if (Proc    ==true)
{
   if(cl>min) { double x=NormalizeDouble(cl*100/min-100,2); }
   if(cl<max) { double y=NormalizeDouble(cl*100/max-100,2); }
   
if (Procent*(-1)<=y&&Close[1]>Open[1]){ sigup=1; sigdw=0; }
if (Procent     >=x&&Close[1]<Open[1]){ sigup=0; sigdw=1; }  
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
   int f=0;
   if(Martin==true)
     {
        if (total==0){f=1    ;}
        if (total>=1){f=total;}
         LotB=Lots_New*f;
         LotS=Lots_New*f;
     }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
if(Martin==false)
  {
LotB=LotS;
LotS=LotB;
  }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//  
if((b==0&&sigup==1&&s==0)||(Ask<opB-dis+spred&&b>=1&&s==0)) { OrderSend(Symbol(),OP_BUY ,LotB,Ask,Slip,0,0,"Buy ",Magic,0,Green); }
if((s==0&&sigdw==1&&b==0)||(Bid>opS+dis+spred&&s>=1&&b==0)) { OrderSend(Symbol(),OP_SELL,LotS,Bid,Slip,0,0,"Sell",Magic,0,Green); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
double TP= NormalizeDouble (spred+TakeProfit*Point,Digits);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
   for (int iq=total-1; iq>=0; iq--)
   {
    if(OrderSelect(iq, SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)
       {   
        if (OrderType()==OP_BUY  &&  OrderTakeProfit()==0 && b==1) 
         {
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(OrderOpenPrice()+TP,Digits),0,Blue);  
         }     
        if (OrderType()==OP_SELL && OrderTakeProfit()==0 && s==1) 
         {
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(OrderOpenPrice()-TP,Digits),0,Blue);  
         }
}}}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
double nn=0,bb=0;
for(int ui=total-1; ui>=0; ui--)
  {
   if(OrderSelect(ui,SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol())
        {
         if(OrderType()==OP_BUY && OrderMagicNumber()==Magic)
           {
            double op=OrderOpenPrice();
            double llot=OrderLots();
            double itog=op*llot;
            bb=bb+itog;
            nn=nn+llot;
            double factb=bb/nn;
           }
        }
     }
  }
double nnn=0,bbb=0;
for(int usi=total-1; usi>=0; usi--)
  {
   if(OrderSelect(usi,SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol())
        {
         if(OrderType()==OP_SELL && OrderMagicNumber()==Magic)
           {
            double ops=OrderOpenPrice();
            double llots=OrderLots();
            double itogs=ops*llots;
            bbb=bbb+itogs;
            nnn=nnn+llots;
            double facts=bbb/nnn;
           }
        }
     }
  }

for(int uui=total-1; uui>=0; uui--)
  {
   if(OrderSelect(uui,SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol())
        {
         if(b>=2 && OrderType()==OP_BUY && OrderMagicNumber()==Magic)
           {
            OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),factb+CORR,0,Blue);
           }
         if(s>=2 && OrderType()==OP_SELL && OrderMagicNumber()==Magic)
           {
            OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),facts-CORR,0,Blue);
           }
        }
     }
  }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
if ( Monitor == true )
{
//WWW.TRADING-GO.RU  full version free
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

Profitability Reports

USD/CAD Jul 2025 - Sep 2025
1.98
Total Trades 90
Won Trades 52
Lost trades 38
Win Rate 57.78 %
Expected payoff 48.86
Gross Profit 8871.21
Gross Loss -4474.07
Total Net Profit 4397.14
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
1.66
Total Trades 67
Won Trades 36
Lost trades 31
Win Rate 53.73 %
Expected payoff 48.04
Gross Profit 8126.04
Gross Loss -4907.13
Total Net Profit 3218.91
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.34
Total Trades 71
Won Trades 39
Lost trades 32
Win Rate 54.93 %
Expected payoff -102.20
Gross Profit 3751.91
Gross Loss -11008.22
Total Net Profit -7256.31
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.44
Total Trades 126
Won Trades 62
Lost trades 64
Win Rate 49.21 %
Expected payoff -56.16
Gross Profit 5581.28
Gross Loss -12657.65
Total Net Profit -7076.37
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.41
Total Trades 100
Won Trades 48
Lost trades 52
Win Rate 48.00 %
Expected payoff -74.67
Gross Profit 5113.22
Gross Loss -12580.04
Total Net Profit -7466.82
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 19
Won Trades 11
Lost trades 8
Win Rate 57.89 %
Expected payoff -18288.71
Gross Profit 1180.37
Gross Loss -348665.85
Total Net Profit -347485.48
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
2.23
Total Trades 64
Won Trades 38
Lost trades 26
Win Rate 59.38 %
Expected payoff 80.54
Gross Profit 9360.02
Gross Loss -4205.23
Total Net Profit 5154.79
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
0.96
Total Trades 397
Won Trades 217
Lost trades 180
Win Rate 54.66 %
Expected payoff -5.69
Gross Profit 52609.13
Gross Loss -54868.24
Total Net Profit -2259.11
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.46
Total Trades 125
Won Trades 68
Lost trades 57
Win Rate 54.40 %
Expected payoff -54.75
Gross Profit 5945.88
Gross Loss -12789.50
Total Net Profit -6843.62
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.77
Total Trades 186
Won Trades 95
Lost trades 91
Win Rate 51.08 %
Expected payoff -33.97
Gross Profit 21648.31
Gross Loss -27966.62
Total Net Profit -6318.31
-100%
-50%
0%
50%
100%

Comments