You need to write an advisor. I have an idea. - page 3

 
lascu.roman писал(а) >>

I originally had the idea of using this on the diaries

 

H4 with the same parameters

 
dimasik >> :

I originally had the idea to use this on the daily

But should I open pending orders also have TP and SL at the same time?

 

H1

 
lascu.roman писал(а) >>

It is certainly possible to open pending orders, but do they also need TP and SL at the same time or what?

Yes, you may set the LOS and SL right away.

 
dimasik >> :

Yes, you can set up Moose and Profeus at once with the pendants.

I'll do it tomorrow if you want. i have to go now. ;-)

 
lascu.roman писал(а) >>

I'll do it tomorrow if you want. I have to go now. ;-)

no problem, thank you very much, if I make a profit from it, I'll be sure to thank you...

 

German DAX

Strategy Tester Report
Break
BroCo-San-Francisco (Build 220)


Symbol FDAXH9 (DAX (eurex) (08:00 - 22:00) Exp 20/03/2009)
Period 1 Hour (H1) 2008.07.07 16:00 - 2009.01.13 21:00 (2007.12.01 - 2009.01.14)
Model All ticks (most accurate method based on all smallest available timeframes)
Parameters TP_e=150; SL_e=50; BreakDown_e=15; BreakUp_e=15; Trailing=35; Lot=0.01;
Bars in history 1770 Modelled ticks 210146 Simulation quality n/a
Chart mismatch errors 602
Initial deposit 200.00
Net profit 1567.39 Total profit 2945.95 Total loss -1378.56
Profitability 2.14 Expected payoff 1.01
Absolute drawdown 2.46 Maximum drawdown 26.18 (1.46%) Relative drawdown 4.65% (12.01)
Total trades 1547 Short positions (% win) 796 (48.87%) Long positions (% win) 751 (44.47%)
Profitable trades (% of all) 723 (46.74%) Loss trades (% of all) 824 (53.26%)
Largest profitable trade 4.83 losing deal -1.74
Average profitable deal 4.07 Deal loss -1.67
Maximum number continuous wins (profit) 9 (40.35) Continuous losses (loss) 14 (-24.36)
Maximum Continuous Profit (number of wins) 40.35 (9) Continuous loss (number of losses) -24.36 (14)
Average continuous winnings 2 Continuous loss 2

 

Here's the delayed version

//+------------------------------------------------------------------+
//| exp_Higt-Low.mq4
//| meta-trader
//| http://mql.mega-project.biz = Тысячи советников и индикаторов бесплатно скачать
//+------------------------------------------------------------------+
#property copyright "meta-trader"
#property link      "http://mql.mega-project.biz = Тысячи советников и индикаторов бесплатно скачать"

extern bool limit=true; // если ТРУЕ ТО ставятся стоп-ордера, а если ФАЛСЕ то ставятся лимитники
//extern int Dist = 10;
extern int BuyDist = 10;
extern int SellDist = 10;

extern int TakeProfit=1000; // тэйкпрофит
extern int Stoploss=40; // стоплосс      
extern int TrailingStop=200; // тралинг
extern bool mini_forex=true; // Если Ваш брокер допускает лоты типа 0,0X то 'mini_forex=true'
extern int Metod_lot=0; // Выбор лота Metod_lot=0 - фиксированный Metod_lot=1 - процент от депозита
extern double Lot=0.1; // Фиксированный размер лота   
extern double LotsPercent=5; // Процент от депозита
extern int MAGIC=1987088; // Магическое число ордера
extern int Slippage=3; // Проскальзывание
extern string comment= "exp_Higt-Low";// Коментарий поз
static int prevtime = 0;
int start()
  {
//----
if(OrdersTotal()>0 &&  TrailingStop!=0)  Trailingstoplossi ();
double iH=iHigh(NULL,0,1);
double iL=iLow(NULL,0,1);
if(Time[0] == prevtime) return(0); prevtime = Time[0];  /*Orders_delet();*/ Orders_open( iH, iL);
//----
   return(0);
  }
//+------------------------------------------------------------------+
void Orders_open(double zH, double zL)
{
int ticket, err;
double tp=0, sl=0;
/*int BuyDist = Dist;
int SellDist = Dist;*/
RefreshRates();
if( limit==true)
{
if( TakeProfit!=0) tp=NormalizeDouble(( zH+ BuyDist*Point+ TakeProfit*Point),Digits);
if( Stoploss!=0) sl=NormalizeDouble(( zH+ BuyDist*Point- Stoploss*Point),Digits);
OrderSend(Symbol(),OP_BUYSTOP, Lotsi(),NormalizeDouble( zH+ BuyDist*Point,Digits), Slippage, sl, tp, comment, MAGIC,0,Green);
if( TakeProfit!=0) tp=NormalizeDouble(( zL- SellDist*Point- TakeProfit*Point),Digits);
if( Stoploss!=0) sl=NormalizeDouble(( zL- SellDist*Point+ Stoploss*Point),Digits);
OrderSend(Symbol(),OP_SELLSTOP, Lotsi(),NormalizeDouble( zL- SellDist*Point,Digits), Slippage, sl, tp, comment, MAGIC,0,Green);
}
else{
if( TakeProfit!=0) tp=NormalizeDouble(( zL- BuyDist*Point+ TakeProfit*Point),Digits);
if( Stoploss!=0) sl=NormalizeDouble(( zL- BuyDist*Point- Stoploss*Point),Digits);
OrderSend(Symbol(),OP_BUYLIMIT, Lotsi(), zL-NormalizeDouble( BuyDist*Point,Digits), Slippage, sl, tp, comment, MAGIC,0,Green);
if( TakeProfit!=0) tp=NormalizeDouble(( zH+ SellDist*Point- TakeProfit*Point),Digits);
if( Stoploss!=0) sl=NormalizeDouble(( zH+ SellDist*Point+ Stoploss*Point),Digits);
OrderSend(Symbol(),OP_SELLLIMIT, Lotsi(), zH+NormalizeDouble( SellDist*Point,Digits), Slippage, sl, tp, comment, MAGIC,0,Green);
}
return(0);
}
//+------------------------------------------------------------------+
double Lotsi(){int rock=1; double Lots;
if ( Metod_lot==0) Lots= Lot;
if ( Metod_lot==1) Lots=MathCeil(AccountBalance()* LotsPercent)/100000;
if ( Lots>MarketInfo(Symbol(),MODE_MAXLOT)) Lots=MarketInfo(Symbol(),MODE_MAXLOT);
if( Lots<MarketInfo(Symbol(),MODE_MINLOT)) Lots=MarketInfo(Symbol(),MODE_MINLOT);
if ( mini_forex==true) rock=2; Lots= NormalizeDouble( Lots, rock); return ( Lots);}
//+------------------------------------------------------------------+
void Trailingstoplossi (){int cnt, total; total=OrdersTotal();
    for( cnt=0; cnt< total; cnt++){
      OrderSelect( cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()&& OrderMagicNumber()== MAGIC){
         if(OrderType()==OP_BUY){RefreshRates();
               if(NormalizeDouble(Bid-OrderOpenPrice(),Digits)>NormalizeDouble(Point* TrailingStop,Digits)){
                  if(OrderStopLoss()<NormalizeDouble(Bid-Point* TrailingStop, Digits)){
                     OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble((Bid-Point* TrailingStop),Digits),OrderTakeProfit(),0,Green);
                    /*return(0);*/}}}
         else {RefreshRates();
               if(NormalizeDouble((OrderOpenPrice()-Ask),Digits)>NormalizeDouble((Point* TrailingStop),Digits)){
                  if((NormalizeDouble(OrderStopLoss(),Digits)>NormalizeDouble((Ask+Point* TrailingStop),Digits)) || (OrderStopLoss()==0)){
                     OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble((Ask+Point* TrailingStop),Digits),OrderTakeProfit(),0,Red);
                    /*return(0);*/}}}}}
   /*return(0);*/
}
//+------------------------------------------------------------------+


Dimasik, I recommend pumping up the history. The modelling quality of 48% is too low to be trusted.

 

Ran the original variant on the pound for 2008. The result is good from 10000 with 1.0 lot on H4, the result is 80000 (take -144, moose -55, trailing -34). But for the month of December and up to 14.01.09 it is losing. And if you place orders not on every candlestick above the hai/under the low, but apply the principle 20/80. If the opening is in the upper 20% of the bar, and the closing is in the lower 20% of the bar, then put sell below the low.

For buy - mirror reflection.

Thus a trend will be defined, even if it is a short-term one. Of course, the number of deals will decrease, but the number of profitable deals will increase and drawdown will decrease. I think this will be an excellent result on large H1 charts.

Reason: