VR---SETKA=3=M

Author: Copyright � 2012, WWW.TRADING-GO.RU .
Profit factor:
0.83
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
2 Views
1 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/CHF Jul 2025 - Sep 2025
1.87
Total Trades 78
Won Trades 42
Lost trades 36
Win Rate 53.85 %
Expected payoff 31.46
Gross Profit 5276.83
Gross Loss -2822.80
Total Net Profit 2454.03
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
1.87
Total Trades 77
Won Trades 42
Lost trades 35
Win Rate 54.55 %
Expected payoff 42.20
Gross Profit 6999.71
Gross Loss -3750.67
Total Net Profit 3249.04
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
1.33
Total Trades 71
Won Trades 39
Lost trades 32
Win Rate 54.93 %
Expected payoff 36.91
Gross Profit 10514.00
Gross Loss -7893.27
Total Net Profit 2620.73
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.39
Total Trades 72
Won Trades 36
Lost trades 36
Win Rate 50.00 %
Expected payoff -100.48
Gross Profit 4620.21
Gross Loss -11854.56
Total Net Profit -7234.35
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.10
Total Trades 34
Won Trades 12
Lost trades 22
Win Rate 35.29 %
Expected payoff -196.01
Gross Profit 774.78
Gross Loss -7439.22
Total Net Profit -6664.44
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.51
Total Trades 169
Won Trades 85
Lost trades 84
Win Rate 50.30 %
Expected payoff -26.95
Gross Profit 4743.13
Gross Loss -9297.07
Total Net Profit -4553.94
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 18
Won Trades 9
Lost trades 9
Win Rate 50.00 %
Expected payoff -18727.20
Gross Profit 850.27
Gross Loss -337939.94
Total Net Profit -337089.67
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
2.27
Total Trades 76
Won Trades 41
Lost trades 35
Win Rate 53.95 %
Expected payoff 26.12
Gross Profit 3548.46
Gross Loss -1563.17
Total Net Profit 1985.29
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
1.31
Total Trades 339
Won Trades 196
Lost trades 143
Win Rate 57.82 %
Expected payoff 32.35
Gross Profit 46255.38
Gross Loss -35290.38
Total Net Profit 10965.00
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
1.61
Total Trades 77
Won Trades 36
Lost trades 41
Win Rate 46.75 %
Expected payoff 24.99
Gross Profit 5061.32
Gross Loss -3137.40
Total Net Profit 1923.92
-100%
-50%
0%
50%
100%

Comments