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

Macd Stochastic Fractal MA5/25 Daily Marylin
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1448
Page 1 of 141
Author:  phil_trade [ Sat Feb 02, 2013 12:19 pm ]
Post subject:  Macd Stochastic Fractal MA5/25 Daily Marylin

Essentials.gif
  • SERIOUS WARNING
  • Most Forex traders lose all their money.
  • Using the robot posted here in trading Forex does not guarantee success.
  • Trading this robot could lead to serious financial loss.
  • Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
  • To trade this robot, you have to understand all concept
please read all post to well understand all concept :

I'm running on live account my Windev/Empty4 version. You will find here Niepce/Tommaso Empty4 transcriptions/Evolutions. Please run it on demo some weeks to find your own settings.


Macd Stochastic Fractal MA5/25 Daily Marylin parameters explanation

MACDMiniLevelToTrade=0.0; Absolute minimum MACD value to allow a trade. Kind of range filter.
SL_MAX=300; The virtual initial stop loss. Use this for risk sizing when using manual lots.
StochLevelMaxToTrade=70; Upper stoch boundary to allow a long order. Automatically revert for shorts.
StochH4LevelMax=70; Upper stoch boundary if using the H4 stoch option. More reactive. Probable more false positives, tough.
UseStochH4ToTakeTrade=false; Enable Stoch H4 instead of D1.
StochOBOSToMoveSL=90; Upper stoch boundary to set SL to BE if crossed, for long orders. Automatically revert for shorts.
UseCloseFriday=false; if true = Close trade parts on friday option.
UseTakeProfitOn3MACD=true; Take profit parts, when reverse MACD condition occurs.
UseFractalFilterToOpenTrades=false; Only take orders in the direction of the last fractal signal.
UseStochD1slowToFilterTrade=true; Only take orders if immediate slow stoch slope in agreement.

UseStochToConfirmCloseOn3MACD=true; For a long order, MACD close will only occur if stoch has crossed down.
UseHighLowCalcForMoveSLOnStoch=true; Will only move SL to the lowest open price (for longs) of a group of trades for the given pair, when enabled. If disabled, SL will be put on the highest open price (for longs), when stoch enter the overbought zone. Revert rules for shorts.
DeltaPipsFromSRZoneToTakeTrade=250; How near is the next most-hit SR zone. Below this value, trade won't occur.
NbHitMaxSRZoneToTakeTrade=4; Under this hit value, don't consider SR zone to be a real one.
DeltaPipsInterMacdToClose=5; Delta in pips between 48h-ago MACD value and current value, to consider a close condition. Overriden if 4 MACD bars align against you.
UseRSI_W1_ToTrade=false; Weekly range filter toggle.
ValeurRSI_W1_ToTrade=52; Upper boundary. Lower is computed internally.
UseRSI_W1_ToCloseTrade=false; Weekly range filter trade closure toggle. Will close open trades if market start to range again.
ValeurRSI_W1_ToCloseTrade=52;See above, same idea.


DeltaPipsMA25=10; Delta max in pips between today and yesterday EMA to allow trade.
DeltaTimeLiveTrades=86400; 24H min between two live trades.
DeltaTimeHistoTrades=14400; 4H min between last closed trade and the new one.
BrokerHasSundayCandle=true; Set to true or false, accordingly. GMT brokers should have this set to true. GMT+2 brokers probably not.
DistanceInterTrade=10; Don't trade again if less than x pips from previous trade open price.
RequiredMarginPercentile=1000; Required margin percent available. Won't trade under.
slippage = 1;
AdvertisedSpread=5.0;Spread Advertised by broker for this pair. In Pips. You must put 150% of the advertised spread. Exemple : if EURUSD advertised spread is 1.0, put 1.5 here.
UseFixedLot=true; Don't use auto lotsize, input manual lotsize.
FixedLot=0.1; Input here.
NbTradeMax=3;Max number of unprotected (no SL) trade for a given pair at a given moment.

Following values should be tweaked only if you intend to use this on another TF than D1 :
PERIOD_FRACTAL=PERIOD_D1; Period for fractal calculation
PERIOD_OSC=PERIOD_D1; Oscillators periods
PERIOD_OSC_SMALL=PERIOD_H4; Lower periods for oscillators
PERIOD_RSI=PERIOD_W1; RSI period
MagicNumber=199;

Official Hymn for Marilyn :) [youtube]https://www.youtube.com/watch?v=LiE1VgWdcQM[/youtube]

Last update :

The version 0.40x is the last official version compatible 100 % with my backtest forextester. You will find in posts, versions modified by users testing various options. Get closer to them for any questions

Mike's Documentation
Marylin Marilyn V_A.pdf
with exp. settings http://www.stevehopwoodforex.com/phpBB3 ... 051#p87051
Marylin Marilyn V_B.docx
TonkaTuff's parameters summary :
http://www.stevehopwoodforex.com/phpBB3 ... 996#p75996
MM Setting Manager 2.1.xlsx
MM Settings Manager 2.2.xlsx
10/02/2014 0.41a for Empty4 build 6xx
MarilynMonroe041a.mq4
19/10/2013 0.40B
-added automatic recognizing if BrokerHasSundayCandle
- adedded DisplayUserFeedback
-adedded Lot size and part-close check
MarilynMonroe_0.40B.mq4
v 0.40x
Bug correction in Move SL On Fractal
MarilynMonroe_0.40a.mq4
v 0.39x
6/10/2013 0.39
missed "Delta pips inter MACD 1-3 to take trade" control form Phil_trade Windev version implanted in Empty4 version by milanes ,
now we have the hope the versions are near indentical
4/10/2013
-some fixes
2/10/2013
-intergration SS_SupportResistance (code by Andrew Summer thank you for this great Indi!!) by milanese
13/9/2013
- Modification of Move SL on Stoch OBOS exit :
added read Stoch Slow N-2 and N-3 to avoid missed signals

MarilynMonroe_039.mq4
v 0.36B
- Modif. on MoveSLOnStochObos module
MarilynMonroe_0.36B.mq4
v 0.36
- merged no_indi fix by PhP71
- changed TimeElapsedSinceLastHistoTrade() calculation, to calculate from closure of last histo trade, instead of opening.
MarilynMonroe_0.36.mq4
SS_SupportResistance_v04b.mq4
MarilynMonroe_0.35_no_indi.mq4
http://www.stevehopwoodforex.com/phpBB3 ... &start=330
MarilynMonroe_0.35.mq4
MarilynMonroe_0.34.mq4
Marilyn V 1.x benchmark 2009-2013 :
147K$ 5 Paires.PNG

Marilyn V 2.x running with my LIVE Windev/Empty4 console : New BenchMark from 2009-2013
FT BenchMark optimized from 2009-2013.PNG
Philippe
Author:  ChicagoRob [ Sat Feb 02, 2013 9:38 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

Looks really solid. Looking forward to seeing this transform into .mq4.

Rob
Author:  niepce [ Sat Feb 02, 2013 10:01 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

I don't get the challenge here (but hell I DO get that hell of an equity curve !).
Is there anything in the Delphi code that is so complex to translate into mql4 ? Or is it just a matter of not having enough spare time to do it ?

Maybe getting the strategy plan in plain english -or in plain froggish if you prefer- might sure helps ?

Jerome
Author:  phil_trade [ Sat Feb 02, 2013 10:08 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

Hi all

I'm using Forexter with Delphi language to develop and backtest trading idea. Then, I'm using Windev language and Empty4 API (via Dot Net) to drive a lot of instance of Empty4 (futur customers purpose) and have access to very high level language with SQL and so on.
That's the reason why I have not transcript my EA to Empty4, but would be glad to share it if someone want to do this work, and may be add some improvements.

I get very good result with 5 pairs : EURUSD / CHFJPY / EURJPY / USDCHF / XAUUSD with test from 01/2011 to 12/2012. Live Test with Windev/Empty4 are ok since 01/12/2012.

Indicators used :
MA5 / MA25
MACD
STOCHASTIC
Support/Resistance for Fractal ans S/R (this indi already exist for Empty4 -> http://www.stevehopwoodforex.com/phpBB3 ... e&start=30


Example of delphi code to translate for Buy Entry

Code: Select all

                   //Buy
                   if ( NbTradeBuy < MACD_NbTradeMax[kk]) and (NbTradeSell = 0) and
                      ( PaireMACD_D1Main[kk,1] > PaireMACD_D1Main[kk,2]) and ( PaireMACD_D1Main[kk,2] > PaireMACD_D1Main[kk,3]) and
                      ( _STOD1SLOW[kk,1] <= MACD_StochLevelToTrade[kk]) and ( _STOD1FAST[kk,1] >  _STOD1SLOW[kk,1]) and ( _STOD1FAST[kk,1] >  _STOD1FAST[kk,2]) and
                      ( PaireMA5[kk,1] > PaireMA5[kk,2]) and ( PaireMA5[kk,2] > PaireMA5[kk,3]) and ( PaireMA25[kk,2] - PaireMA25[kk,1] < MACD_DeltaPipsMA25[kk]*Point ) and
                      ((MonNbHour > MACD_HOURDELAY[kk] ) or (MonNbHour=9999)) and ((MonNbHourHistoBUY > MACD_HOURDELAY2[kk] ) or (MonNbHourHistoBUY=9999))  then
                   begin

                   DistanceLastPrice := true;
                   DernierPrix := RenvoieLastOpenPrice(PaireDevise[kk],0);

                   if (DernierPrix > 0) then
                     begin
                     if MonBid > DernierPrix then
                     begin
                        if (MonBid - DernierPrix < MACD_DistanceInterTrade[kk]*Point) then DistanceLastPrice := false;
                     end
                     else
                     begin
                        if (DernierPrix  - MonBid < MACD_DistanceInterTrade[kk]*Point) then DistanceLastPrice := false;
                     end;
                   end;



                       //contrôle distance S/R > MACD_DeltaPipsFromSRToTakeTrade[kk]
                        DistanceSR := true;
                        for k:=0 to 50 do
                        begin
                          MonObjet := 'SSSR#'+IntTostr(k);
                          if ObjectExists(MonObjet) then
                          begin

                          MonTypeZone := ObjectGet(MonObjet,OBJPROP_STYLE);
                          MonNbHitZone := ObjectGet(MonObjet,OBJPROP_WIDTH);

                              if MonNbHitZone >=4 then
                              begin
                                  MonPrixHaut := RoundTo(ObjectGet(MonObjet, OBJPROP_PRICE1),-digits);
                                  MonPrixBas := RoundTo(ObjectGet(MonObjet, OBJPROP_PRICE2),-digits);

                                  // Prix trop proche S/R ou dans S/R
                                  if  ((MonBid <= MonPrixBas) and (MonPrixBas - MonBid < (250 * MonPoint) )) or
                                  ((MonBid >= MonPrixBas) and (MonBid <= MonPrixHaut)) or (MonPrixHaut * MonPrixBas =0) then
                                  begin
                                    DistanceSR := false;
                                    break;
                                  end;

                              end;

                          end
                          else break;

                        end;

                       // si date fractal Slow DN est plus récente que Slow UP -> sens fractal = hausse sinon baisse
                       if UseFractalSlowToOpenTrade then
                       begin
                       if PaireFractalDateH4[kk,1] < PaireFractalDateH4[kk,2]  then DistanceSr := false else
                       begin
                         Lprint(PaireDevise[kk]+' -> Slow Fractal DN = '+MaValeurToStr(PaireFractalValueH4[kk,1],Digits)+' le '+DateTimeToStr(PaireFractalDateH4[kk,1])
                         +' -> Fractal UP = '+MaValeurToStr(PaireFractalValueH4[kk,2],Digits)+' le '+DateTimeToStr(PaireFractalDateH4[kk,2]) ) ;
                       end;
                       end;

                       // si date fractal Slow DN est plus récente que Slow UP -> sens fractal = hausse sinon baisse
                       if UseFractalFastToOpenTrade then
                       begin
                       if PaireFractalDateH4[kk,3] < PaireFractalDateH4[kk,4]  then DistanceSr := false else
                       begin
                         Lprint(PaireDevise[kk]+' -> Fast Fractal DN = '+MaValeurToStr(PaireFractalValueH4[kk,3],Digits)+' le '+DateTimeToStr(PaireFractalDateH4[kk,3])
                         +' -> Fractal UP = '+MaValeurToStr(PaireFractalValueH4[kk,4],Digits)+' le '+DateTimeToStr(PaireFractalDateH4[kk,4]) ) ;
                       end;
                       end;

                          if (DistanceSR = true) and (DistanceLastPrice = true) then
                          begin

                          Lprint(PaireDevise[kk]+' -> Buy sur Cross MACD '+MAValeurToStr(PaireMACD_H4Main[kk,2],Digits)+' < '+ MAValeurToStr(PaireMACD_H4Signal[kk,2],Digits) +
                          ' et '+MAValeurToStr(PaireMACD_H4Signal[kk,1],Digits)+' < '+MAValeurToStr(PaireMACD_H4Main[kk,1],Digits) );

                          if UseFractalFastToCloseTrade=true then NewTP := 0 else NewTP := Bid + (MACD_TP[kk]*Point);

                          SendInstantOrder( PaireDevise[kk], op_Buy, Nbre_Lot_Debut , 0, NewTP ,'', 1 , OrderHandle) ;
                          end;

                   end;
FT2 Test result from 2012 to 2012 ( Green = Balance / Blue = Equity / White = Margin )
Fix Lot - Without option Close on Friday
147K$ 5 Paires.PNG
Fix Lot - With option Partial Close on Friday
107K$ 5 Paires with Close Partiel Vendredi.PNG
If someone is interested, dont' hesitate to ask explanation and don't be afraid to fight with my english :) !
As we are speaking of the settings here are some sum-up of things I never explained clearly before :

niepce wrote:I don't get the challenge here (but hell I DO get that hell of an equity curve !).
Is there anything in the Delphi code that is so complex to translate into mql4 ? Or is it just a matter of not having enough spare time to do it ?

Maybe getting the strategy plan in plain english -or in plain froggish if you prefer- might sure helps ?

Jerome
Matter of time and also no interest (for me of course) as I already run it live with my Windev/Empty4. But I want to share it with this forum where I also learn a lot and also may be get it stronger. I will give all detail information asap someone want to involve time to this conversion for the forum.

Here is the previous version live statement from Windev/Empty4
WINDEV TO Empty4 Previuos Live Version From 2012 12 14 to 2013 01 30.PNG
I hope I could open subcription to manage account by Windev/Empty4 after some more month of live test. For now, live account must be in MIB Bank wioth 2500 uS$ minimum balance. I will run some test with Jem Global Forex Broker next month as he offer 0.01 lot even if leverage is only 1:200. This will allow to run 625US$ minimal account.
Author:  niepce [ Sat Feb 02, 2013 10:14 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

Factor 5.80
DD 2%
:)

And the strategy is ? :)
You can PM the delphi code, i will check if i can make my way through it.
Or why not dump it right here ?
Author:  ChicagoRob [ Sat Feb 02, 2013 10:16 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

I like the high profit factor and low DD. I know a guy who can probably code this,
so I'll run it by him for an estimate.

However, I would like to see a bigger data sample - 39 trades is a very small slice
of the forex pie.

Rob
Author:  phil_trade [ Sat Feb 02, 2013 10:20 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

niepce wrote:Factor 5.80
DD 2%
:)

And the strategy is ? :)
You can PM the delphi code, i will check if i can make my way through it.
Or why not dump it right here ?
Difficult to throught out 20100 lines of code... a lot of function that are not use anymore etc
I have to extract the good one as I have done for my Windev/Empty4 conversion.
I will do that with a clear explanation of strategy next days.
Author:  phil_trade [ Sat Feb 02, 2013 10:23 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

ChicagoRob wrote:I like the high profit factor and low DD. I know a guy who can probably code this,
so I'll run it by him for an estimate.

However, I would like to see a bigger data sample - 39 trades is a very small slice
of the forex pie.

Rob
Ya, it's a daily strategy which hold for long time trade...so no much trade ! I hope the 2 years test from ForexTester is long enough to prove us this strategy as legs !
Author:  niepce [ Sat Feb 02, 2013 10:24 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

Okay, im all ears.

MIG restriction is due to Empty4 dotnet API licensing ?
Author:  phil_trade [ Sat Feb 02, 2013 10:35 pm ]
Post subject:  Re: MACD STOCHASTIC FRACTAL MA5/25 DAILY EA

phil_trade wrote:
niepce wrote:Okay, im all ears.

MIG restriction is due to Empty4 dotnet API licensing ?
No ( Empty4 .NET API is my licence) but this is where I have my lives accounts and I saw different trade when driving simultanously accounts from MIG / ALPARI and HOTFOREX due to different data feed etc.

So I can trust my MIG account result and FT 2 years tests...but we will have to confirm with other broker. And I don't want to give time for this now. Even Daily MACD is different on Alpari and MIG ( and see Pivot difference with GMT time here in the forum)...so my futur customer will have to open MIG account :)
All times are UTC Page 1 of 141