UpDn-Alexander Piechotta





//+------------------------------------------------------------------+
extern double TakeProfit = 7; 
extern double Lots = 0.1; 
extern double TrailingStop = 5; 
extern double StopLoss = 30; 

int start() 
{ 
double pos1pre=0; 
double  pos2cur=0; 
int cnt=0; 
int mode=0; 
double openpozprice=0; 




pos1pre = iBullsPower(NULL,0,13,PRICE_WEIGHTED,1); 
pos2cur = iBullsPower(NULL,0,13,PRICE_WEIGHTED,0); 
//Comment("??????? ???????  ",pos2cur,"Previous pos", pos1pre ); 

if (pos1pre >pos2cur) { 
//????????? ??????? ??????? 

for (cnt=1; cnt<OrdersTotal(); cnt++) 

{ 

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); 
        if( OrderSymbol()==Symbol() && OrderType()==OP_BUY ) 


         { 
         if (Bid>(OrderOpenPrice()+TrailingStop*Point)) 
     { 
       OrderClose(OrderTicket(),OrderLots(),Bid,5,Violet); 
     return(0); 
         } 
         } 
  } 
} 


if (pos2cur<0) 
//????????? ???????? ??????? 

{ 

for (cnt=1; cnt<OrdersTotal(); cnt++) 
{ 


OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); 
      if( OrderSymbol()==Symbol() && OrderType()==OP_SELL ) 
         { 

   if (Ask< (OrderOpenPrice()-TrailingStop*Point)) 
         { 
                    OrderClose(OrderTicket(),OrderLots(),Ask,5,Violet); 
     return(0); 
           }       } 
      } 
} 


if (OrdersTotal() < 1 ) 
{ 

Print("pos1pre = "+pos1pre+"    pos2cur ="+pos2cur); 
if (pos1pre>pos2cur && pos2cur>0)       { 

int ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"",0,0,Gold); 
            return(0); 
    } 
   // ????????? ?? ??????????? ?????? ? ??????? ??????? (BUY) 

if (pos2cur<0)   { 
// print("K = "+K+"   S ="+S); 
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"",0,0,Gold); 
    return(0); 
   } 
  } 

} 





Sample





Analysis



Market Information Used:



Indicator Curves created:


Indicators Used:

Bulls Power indicator


Custom Indicators Used:

Order Management characteristics:
Checks for the total of open orders

It Closes Orders by itself
It automatically opens orders when conditions are reached

Other Features:

BackTest : EURUSD on H1

From 2009-08-01 to 2009-10-01 Profit Factor:0.10 Total Net Profit:-327.45

BackTest : EURUSD on H1

From 2009-12-01 to 2010-01-17 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-04-01 to 2010-04-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-05-01 to 2010-05-31 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-06-01 to 2010-06-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : GBPUSD on H1

From 2010-01-01 to 2010-02-27 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDCAD on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDCHF on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.01 Total Net Profit:-268.17

BackTest : USDJPY on H1

From 2009-11-01 to 2009-11-30 Profit Factor:0.00 Total Net Profit:0.00

Request Backtest for UpDn-Alexander Piechotta


From : (yyyy/mm/dd) To: (yyyy/mm/dd)

Pair: Period: