stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Brakeout of the monday's night
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3224
Page 7 of 9
Author:  michalkraus [ Thu Nov 07, 2013 9:03 am ]
Post subject:  Re: Brakeout of the monday's night

phil_trade wrote:
michalkraus wrote:Phil I got an idea, try to test the same conditions, but just dont count the first one hour candle of the week, so the zone will be created by the second candle of the week and last candle before london session starts. I think we can avoid the first large candle, i hope this could help....
I'm in V4...so already tested this. I have a bunch of parameters now :lol:

The fact is that this strategy has a good potential, but from time to time, can add loss after loss that could blow up your account, specially with so much JPY pairs.

So I'm trying a lot of MM module, filters etc to obtain a smooth result.

cheers

Philippe
Have you tried other pairs beside the JPY?
Author:  phil_trade [ Thu Nov 07, 2013 9:14 am ]
Post subject:  Re: Brakeout of the monday's night

michalkraus wrote:
phil_trade wrote:
michalkraus wrote:Phil I got an idea, try to test the same conditions, but just dont count the first one hour candle of the week, so the zone will be created by the second candle of the week and last candle before london session starts. I think we can avoid the first large candle, i hope this could help....
I'm in V4...so already tested this. I have a bunch of parameters now :lol:

The fact is that this strategy has a good potential, but from time to time, can add loss after loss that could blow up your account, specially with so much JPY pairs.

So I'm trying a lot of MM module, filters etc to obtain a smooth result.

cheers

Philippe
Have you tried other pairs beside the JPY?
XAUUSD
Author:  phil_trade [ Fri Nov 08, 2013 3:37 pm ]
Post subject:  Re: Brakeout of the monday's night

Version V6

this should be acceptable no ? :P

BenchMark EURJPY just oPtimised on worst period of 2010 - a little bit flat on 2013 :?
EURJPY Graph 2008 2013 +33.9K$ with low DD.PNG
Author:  michalkraus [ Sat Nov 09, 2013 1:10 pm ]
Post subject:  Re: Brakeout of the monday's night

phil_trade wrote:Version V6

this should be acceptable no ? :P

BenchMark EURJPY just oPtimised on worst period of 2010 - a little bit flat on 2013 :?
EURJPY Graph 2008 2013 +33.9K$ with low DD.PNG
Hello Phill great to here that you could optimised, with such a great results. I guess you are testing other pairs arent you? I hope that live results will be about the same :-) thank you man for so much work
Author:  phil_trade [ Sat Nov 09, 2013 2:03 pm ]
Post subject:  Re: Brakeout of the monday's night

michalkraus wrote:
phil_trade wrote:Version V6

this should be acceptable no ? :P

BenchMark EURJPY just oPtimised on worst period of 2010 - a little bit flat on 2013 :?
EURJPY Graph 2008 2013 +33.9K$ with low DD.PNG
Hello Phill great to here that you could optimised, with such a great results. I guess you are testing other pairs arent you? I hope that live results will be about the same :-) thank you man for so much work
As you can see, this strategy, as a lot, need some trend to return some gains. Since beginning 2013, it's quite flat... so live trading will depend on trend or not !

Yes, I will try with other pairs asap
Author:  SpiderX [ Wed Nov 13, 2013 2:05 am ]
Post subject:  Re: Brakeout of the monday's night

Hi Phil,

I just recalled that i have read about a similar strategy to this before.
There are some additional rules for this:
1. Zone must be minimum n pips. (80-90 pips, have to optimize)
2. Previous week should have strong directional movement and only trade in the previous week's direction.
(My guess: Assume that this means that previous weekly candle has short wick and long body relative to the wick, body length minimum x pips, or maybe some function of ATR ?)

The end result should be fewer setups, but higher probability wins.

Can you try this out ?

Cheers
Author:  phil_trade [ Wed Nov 13, 2013 7:33 am ]
Post subject:  Re: Brakeout of the monday's night

SpiderX wrote:Hi Phil,

I just recalled that i have read about a similar strategy to this before.
There are some additional rules for this:
1. Zone must be minimum n pips. (80-90 pips, have to optimize)
2. Previous week should have strong directional movement and only trade in the previous week's direction.
(My guess: Assume that this means that previous weekly candle has short wick and long body relative to the wick, body length minimum x pips, or maybe some function of ATR ?)

The end result should be fewer setups, but higher probability wins.

Can you try this out ?

Cheers
Hello

1 - I already have add Min / Max heigh zone. Some pairs performed best with it.

2 - I have done similary test with ADR(14), but I will try with simple last W1 candle.

My best version (V9) for EURJPY : not so bad :
Author:  michalkraus [ Wed Nov 13, 2013 12:25 pm ]
Post subject:  Re: Brakeout of the monday's night

phil_trade wrote:
SpiderX wrote:Hi Phil,

I just recalled that i have read about a similar strategy to this before.
There are some additional rules for this:
1. Zone must be minimum n pips. (80-90 pips, have to optimize)
2. Previous week should have strong directional movement and only trade in the previous week's direction.
(My guess: Assume that this means that previous weekly candle has short wick and long body relative to the wick, body length minimum x pips, or maybe some function of ATR ?)

The end result should be fewer setups, but higher probability wins.

Can you try this out ?

Cheers
Hello

1 - I already have add Min / Max heigh zone. Some pairs performed best with it.

2 - I have done similary test with ADR(14), but I will try with simple last W1 candle.

My best version (V9) for EURJPY : not so bad :
Awesome work, I feel like you are getting really close to the best possible results
Author:  phil_trade [ Mon Nov 18, 2013 6:05 am ]
Post subject:  Re: Brakeout of the monday's night

Hello Michal and Tommaso

Now the strategy is OK for EURJPY, so please find below the FT code to translate into MQL.

Feel free to contact me if more explanation needed.

cheers

Philippe

1 - Code to detect Monday Zone

Code: Select all

// Sommes-nous dans la zone Lundi 00H à 09H
MonJour := DayOfTheWeek(TimeCurrent);
MonHeure := HourOf(Timecurrent);

if (MonJour = 1) and (MonHeure < HeureFinDeMondayZone[PointeurPaire]) then
begin
// Nettoyer tableaux de High/Low
HighMondayZone[PointeurPaire] := 0;
LowMondayZone[PointeurPaire] := 0;
FlagTraceRectangle[PointeurPaire] := 0;

// sortir en attente fin de création de la zone
exit;
end;  // if (MonJour = 1) and (MonHeure < HeureFinDeMondayZone[PointeurPaire]) then

2 - Code to store High/Low MZBO

Code: Select all

// Fin de création de la zone -> Mémoriser les niveaux
if (MonJour = 1) and (MonHeure = HeureFinDeMondayZone[PointeurPaire]) and (LowMondayZone[PointeurPaire] = 0) then
begin
HighMondayZone[PointeurPaire] := 0;
LowMondayZone[PointeurPaire] := 99999999;

for i := HeureFinDeMondayZone[PointeurPaire] downto 0  do
begin

  MonHigh := iHigh(PaireDevise[PointeurPaire],period_H1,i);
  if MonHigh > HighMondayZone[PointeurPaire] then HighMondayZone[PointeurPaire] := MonHigh ;
  MonLow := iLow(PaireDevise[PointeurPaire],period_H1,i);
  if MonLow < LowMondayZone[PointeurPaire] then LowMondayZone[PointeurPaire] := MonLow ;

end;  // for i := 0 to HeureFinDeMondayZone[PointeurPaire]-1  do

end;  // if (MonJour = 1) and (MonHeure < HeureFinDeMondayZone[PointeurPaire]) then
3 - Code to set Pending Trade and Trace zone on graph

Code: Select all

// Pose des trades en break de zone up et down
if (MonJour = 1) and (MonHeure = HeureFinDeMondayZone[PointeurPaire]) and (LowMondayZone[PointeurPaire] > 0) and  (FlagTraceRectangle[PointeurPaire] = 0)then
begin

SetCurrencyAndTimeframe(PaireDevise[PointeurPaire], 1);
MonBid := RoundTo(Bid, -Digits);
MonPoint := Point;

// Trace la Zone de Monday Break OUT et contrôle le % de taille / ADR(14)
if EnOptimisation = 0 then
begin

ObjectsDeleteAll(0,obj_HLine);

MonTemps1 := iTime(PaireDevise[PointeurPaire],Period_H1,HeureFinDeMondayZone[PointeurPaire]) ;
MonTemps2 := iTime(PaireDevise[PointeurPaire],Period_H1,1);
TailleZone := abs((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire]));

ADR_D1_Value[PointeurPaire] :=0;
for i := 1 to 14 do
begin
    MonHigh := iHigh(PaireDevise[PointeurPaire], Period_D1, i);
    MonLow  := iLow (PaireDevise[PointeurPaire], Period_D1, i);
    MaTaille := (MonHigh - MonLow)  / MonPoint;
    ADR_D1_Value[PointeurPaire] := ADR_D1_Value[PointeurPaire] + MaTaille ;
end;
ADR_D1_Value[PointeurPaire] := ADR_D1_Value[PointeurPaire] / 14;

if (TailleZone/MonPoint) > (ADR_D1_Value[PointeurPaire] * 0.50) then
begin
   CouleurRectangle := clRED;
   NbTailleZoneSupADR[PointeurPaire] := NbTailleZoneSupADR[PointeurPaire] + 1;
   AfficheOnGraph(PaireDevise[PointeurPaire],'Ratio MZBO/ADR',
   ' MZBO > ADR = '+MaValeurToStr(NbTailleZoneSupADR[PointeurPaire],0)+' / MZBO < ADR = '+MaValeurToStr(NbTailleZoneInfADR[PointeurPaire],0)
   ,clYellow,200,20);
end
else
begin
   CouleurRectangle := clGREEN;
   NbTailleZoneInfADR[PointeurPaire] := NbTailleZoneInfADR[PointeurPaire] + 1;
   AfficheOnGraph(PaireDevise[PointeurPaire],'Ratio MZBO/ADR',
   ' MZBO > ADR = '+MaValeurToStr(NbTailleZoneSupADR[PointeurPaire],0)+' / MZBO < ADR = '+MaValeurToStr(NbTailleZoneInfADR[PointeurPaire],0)
   ,clYellow,200,20);
end;

TraceRectangle(PaireDevise[PointeurPaire], HighMondayZone[PointeurPaire],MonTemps1,LowMondayZone[PointeurPaire],MonTemps2, CouleurRectangle,
 'MZBO Taille '+MaValeurToStr(TailleZone/MonPoint,0)+' / ADR '+MaValeurToStr(ADR_D1_Value[PointeurPaire],0)+
 ' / Ratio '+MaValeurToStr( ((TailleZone/MonPoint) / ADR_D1_Value[PointeurPaire] ) *100 ,2),0 );

TraceHLigne(PaireDevise[PointeurPaire] ,Period_H1, HighMondayZone[PointeurPaire] + (ADR_D1_Value[PointeurPaire] * MonPoint),clGreen,psDot,'TP1',0);
TraceHLigne(PaireDevise[PointeurPaire] ,Period_H1, LowMondayZone[PointeurPaire] - (ADR_D1_Value[PointeurPaire] * MonPoint),clRed,psDot,'TP2',0);

FlagTraceRectangle[PointeurPaire] := 1;
end;



TailleZone := abs((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire]));
if (TailleZone >= TailleZoneMini[PointeurPaire] * MonPoint) and (TailleZone <= TailleZoneMaxi[PointeurPaire] * MonPoint)then
begin

if (IsThereNoActiveTrade(PaireDevise[PointeurPaire],tp_buy,0) = 0) and (IsThereNoActiveTrade(PaireDevise[PointeurPaire],tp_sell,0) = 0) then
begin

if IsThisDeviseTradable(PaireDevise[PointeurPaire],0,0,0,999999) = 0 then
begin

  NbLot := Nbre_Lot_Debut/3;

  MonPrixLimite  := HighMondayZone[PointeurPaire] + (DeltaPipsToTakeTradeOnMondayZoneBreak[PointeurPaire] * MonPoint);
  if (MonPrixLimite - MonBid < 5 * MonPoint) then MonPrixLimite := MonPrixLimite + (5*MonPoint) ;

  NewSL := LowMondayZone[PointeurPaire] - (DeltaPipsToAddSLOnMondayZone[PointeurPaire] * MonPoint) - ((SL_Multiplier[PointeurPaire]) * (abs(HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));

  NewTP := HighMondayZone[PointeurPaire] + ((1 * TP_Multiplier[PointeurPaire]) * ((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));

  SendPendingOrder( PaireDevise[PointeurPaire], op_BuyStop, NbLot , NewSL, NewTP ,MonPrixLimite ,'', MagicNumber1 , OrderHandle) ;

  NewTP := HighMondayZone[PointeurPaire] + ((2 * TP_Multiplier[PointeurPaire]) * ((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));

  SendPendingOrder( PaireDevise[PointeurPaire], op_BuyStop, NbLot , NewSL, NewTP ,MonPrixLimite ,'', MagicNumber2 , OrderHandle) ;

  if FixedTPforTrade3[PointeurPaire]=1 then
  begin
  NewTP := HighMondayZone[PointeurPaire] + ((3 * TP_Multiplier[PointeurPaire]) * ((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));
  end
  else
  begin
  NewTP := 0;
  end;

  SendPendingOrder( PaireDevise[PointeurPaire], op_BuyStop, NbLot , NewSL, NewTP ,MonPrixLimite ,'', MagicNumber3 , OrderHandle) ;

end; // if IsThisDeviseTradable(PaireDevise[PointeurPaire],0,0,0,999999) = 0 then

if IsThisDeviseTradable(PaireDevise[PointeurPaire],1,0,0,999999) = 0 then
begin

  NbLot := Nbre_Lot_Debut/3;

  MonPrixLimite  := LowMondayZone[PointeurPaire] - (DeltaPipsToTakeTradeOnMondayZoneBreak[PointeurPaire] * MonPoint);
  if (MonBid - MonPrixLimite < 5 * MonPoint) then MonPrixLimite := MonPrixLimite - (5*MonPoint) ;

  NewSL := HighMondayZone[PointeurPaire] + (DeltaPipsToAddSLOnMondayZone[PointeurPaire] * MonPoint) + ((SL_Multiplier[PointeurPaire]) * (abs(HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));

  NewTP := LowMondayZone[PointeurPaire] - ((1 * TP_Multiplier[PointeurPaire]) * ((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));

  SendPendingOrder( PaireDevise[PointeurPaire], op_SellStop, NbLot , NewSL, NewTP ,MonPrixLimite ,'', MagicNumber1 , OrderHandle) ;

  NewTP := LowMondayZone[PointeurPaire] - ((2 * TP_Multiplier[PointeurPaire]) * ((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));

  SendPendingOrder( PaireDevise[PointeurPaire], op_SellStop, NbLot , NewSL, NewTP ,MonPrixLimite ,'', MagicNumber2 , OrderHandle) ;

  if FixedTPforTrade3[PointeurPaire]=1 then
  begin
  NewTP := LowMondayZone[PointeurPaire] - ((3 * TP_Multiplier[PointeurPaire]) * ((HighMondayZone[PointeurPaire] - LowMondayZone[PointeurPaire])));
  end
  else
  begin
  NewTP := 0;
  end;

  SendPendingOrder( PaireDevise[PointeurPaire], op_SellStop, NbLot , NewSL, NewTP ,MonPrixLimite ,'', MagicNumber3 , OrderHandle) ;

end;  // if IsThisDeviseTradable(PaireDevise[PointeurPaire],1,0,0,999999) = 0 then

end;  // if IsThereNoActiveTrade(PaireDevise[PointeurPaire],0) = 0 then

end;  // if (TailleZone >= TailleZoneMini[j] * MonPoint) and (TailleZone <= TailleZoneMaxi[j] * MonPoint)then

end;  // if (MonJour = 1) and (MonHeure = HeureFinDeMondayZone[PointeurPaire]) and (LowMondayZone[PointeurPaire] > 0) then


4 - Code to Close Live Order and Delete Pending Order on Friday

Code: Select all

    // Vendredi 21H -> Close all pour nouvelle semaine
    MonJour := DayOfTheWeek(TimeCurrent);
    MonHeure := HourOf(Timecurrent);
    if (MonJour = 5) and (MonHeure >= 20) then
    begin
        DeletePendingSell(PaireDevise[j],OrderTicket);
        DeletePendingBuy(PaireDevise[j],OrderTicket);
        FermeTradeDevise(PaireDevise[j],tp_sell,0,999999);
        FermeTradeDevise(PaireDevise[j],tp_buy,0,999999);
        // Exporte trade pour analyse
        WriteTrade;
    end;
5 - Code to Move SL when TP or When Delta pips Zone achieved

Code: Select all

      // Approche ou Touché de TP1 ********************************************************************************************************************
      if (OrderType = tp_buy) then
      begin
        // si TP1 touché Move SL = OPEN
        if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then
        begin
        if (IsThereNoActiveTrade(PaireDevise[j],tp_buy,MonTicket) = 2)  then
        begin
          TailleZone := abs(((1 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          NewSL := OrderOpenPrice ;
          if (Abs(MonBid - NewSL) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL > OrderStopLoss) and (NewSL < MonBid) then
          begin
             ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
        end;  // if (IsThereNoActiveTrade(PaireDevise[j],tp_buy,MonTicket) = 2) then

        end
        else
        begin
        // si % TailleZone parcourue -> Move SL + %TailleZone
          TailleZone := abs(((1 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          if (MonBid - OrderOpenPrice) >= (TailleZone * PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j]) then
          begin
          NewSL := OrderOpenPrice + (TailleZone * PourcentageTailleZoneToPutSLBeforeTpHit[j]);
          if (Abs(MonBid - NewSL) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL > OrderStopLoss)  and (NewSL < MonBid) then
          begin
             ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
          end;
        end;  // if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then

      end;  // if (OrderType = tp_buy) then

      if (OrderType = tp_sell) then
      begin
        // si TP1 touché Move SL = OPEN
        if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then
        begin
        if (IsThereNoActiveTrade(PaireDevise[j],tp_sell,MonTicket) = 2)  then
        begin
          TailleZone := abs(((1 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          NewSL := OrderOpenPrice ;
          if (Abs(NewSL - MonBid) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL < OrderStopLoss) and (NewSL > MonBid) then
          begin
            ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
        end;  // if (IsThereNoActiveTrade(PaireDevise[j],tp_buy,MonTicket) = 2) then

        end
        else
        begin
        // si % TailleZone parcourue -> Move SL = OPEN + %TailleZone
          TailleZone := abs(((1 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          if (OrderOpenPrice - MonBid) >= (TailleZone * PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j]) then
          begin
          NewSL := OrderOpenPrice - (TailleZone * PourcentageTailleZoneToPutSLBeforeTpHit[j]);
          if (Abs(NewSL - MonBid) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL < OrderStopLoss) and (NewSL > MonBid) then
          begin
             ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
          end;
        end;  // if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then

      end;  // if (OrderType = tp_sell) then
      // Approche ou Touché de TP1 ********************************************************************************************************************



      // Approche ou Touché de TP2 ********************************************************************************************************************
      if (OrderType = tp_buy) then
      begin
        // si TP1 touché Move SL = OPEN
        if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then
        begin
        if (IsThereNoActiveTrade(PaireDevise[j],tp_buy,MonTicket) = 1)  then
        begin
          TailleZone := abs(((2 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          NewSL := OrderOpenPrice + TailleZone ;
          if (Abs(MonBid - NewSL) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL > OrderStopLoss) and (NewSL < MonBid) then
          begin
             ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
        end;  // if (IsThereNoActiveTrade(PaireDevise[j],tp_buy,MonTicket) = 2) then

        end
        else
        begin
        // si % TailleZone parcourue -> Move SL + %TailleZone
          TailleZone := abs(((2 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          if (MonBid - OrderOpenPrice) >= (TailleZone * PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j]) then
          begin
          NewSL := OrderOpenPrice + (TailleZone * PourcentageTailleZoneToPutSLBeforeTpHit[j] * 2);
          if (Abs(MonBid - NewSL) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL > OrderStopLoss)  and (NewSL < MonBid) then
          begin
             ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
          end;
        end;  // if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then

      end;  // if (OrderType = tp_buy) then

      if (OrderType = tp_sell) then
      begin
        // si TP1 touché Move SL = OPEN
        if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then
        begin
        if (IsThereNoActiveTrade(PaireDevise[j],tp_sell,MonTicket) = 1)  then
        begin
          TailleZone := abs(((2 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          NewSL := OrderOpenPrice - TailleZone ;
          if (Abs(NewSL - MonBid) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL < OrderStopLoss) and (NewSL > MonBid) then
          begin
            ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
        end;  // if (IsThereNoActiveTrade(PaireDevise[j],tp_buy,MonTicket) = 2) then

        end
        else
        begin
        // si % TailleZone parcourue -> Move SL = OPEN + %TailleZone
          TailleZone := abs(((2 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          if (OrderOpenPrice - MonBid) >= (TailleZone * PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j]) then
          begin
          NewSL := OrderOpenPrice - (TailleZone * PourcentageTailleZoneToPutSLBeforeTpHit[j] * 2);
          if (Abs(NewSL - MonBid) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL < OrderStopLoss) and (NewSL > MonBid) then
          begin
             ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
          end;
          end;
        end;  // if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] = 0) then

      end;  // if (OrderType = tp_sell) then
      // Approche ou Touché de TP2 ********************************************************************************************************************


      // Approche TP3 ********************************************************************************************************************
      if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] > 0) then
      begin

      if (OrderType = tp_buy) then
      begin

        // si % TailleZone parcourue -> Move SL + %TailleZone
          TailleZone := abs(((3 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          if (MonBid - OrderOpenPrice) >= (TailleZone * PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j]) then
          begin
            NewSL := OrderOpenPrice + (TailleZone * PourcentageTailleZoneToPutSLBeforeTpHit[j] * 3);
            if (Abs(MonBid - NewSL) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL > OrderStopLoss)  and (NewSL < MonBid) then
            begin
               ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
            end;
          end;

      end;  // if (OrderType = tp_buy) then

      if (OrderType = tp_sell) then
      begin
        // si % TailleZone parcourue -> Move SL = OPEN + %TailleZone
          TailleZone := abs(((3 * TP_Multiplier[j]) *(HighMondayZone[j] - LowMondayZone[j])));
          if (OrderOpenPrice - MonBid) >= (TailleZone * PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] * 3) then
          begin
            NewSL := OrderOpenPrice - (TailleZone * PourcentageTailleZoneToPutSLBeforeTpHit[j]);
            if (Abs(NewSL - MonBid) > 5*MonPoint) and (Abs(NewSL - OrderStopLoss) > 10*MonPoint) and (NewSL < OrderStopLoss) and (NewSL > MonBid) then
            begin
               ModifyOrder(OrderTicket,OrderOpenPrice,NewSL,OrderTakeProfit);
            end;
          end;

      end;  // if (OrderType = tp_sell) then

      end;  // if (PourcentageTailleZoneToDecideToMoveSLBeforeTpHit[j] > 0) then

EURJPY Benchmark 2008 - 2013 for MZBO strategy
Author:  milanese [ Mon Nov 18, 2013 8:54 am ]
Post subject:  Re: Brakeout of the monday's night

phil_trade wrote:Hello Michal and Tommaso

Now the strategy is OK for EURJPY, so please find below the FT code to translate into MQL.

Feel free to contact me if more explanation needed.

cheers

Philippe
Hi Philippe and Michal,

got the code and I will try to create the mq4 EA...


Cheers and have a great week :)

Tommaso
All times are UTC Page 7 of 9