Let's try 0.33 version. It implements a security feature on the CloseOnMACD from Phil (by doing some additionnal checks on the fourth bar in history). A bug in iRSI call was corrected, thanks to NMSS for spotting it. Made some improvement in iCustom calls on Phil's advices to reduce CPU.
MarilynMonroe_0.33.mq4
Important changes :
RSI Weekly range filter and RSI Trade range close routine are now enabled by default.
All W1 RSI value ranging between 48/52 will either prevent from trading, either close your already opened trade, in profit or not.
You can disable this feature using the EA settings.
As we are speaking of the settings here are some sum-up of things I never explained clearly before :
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=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=true; Weekly range filter toggle.
ValeurRSI_W1_ToTrade=52; Upper boundary. Lower is computed internally.
UseRSI_W1_ToCloseTrade=true; 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 min 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;
I also attach a sample setfiles I use on demo.
xauusd.set
audjpy.set
audusd.set
chfjpy.set
eurjpy.set
eurusd.set
usdchf.set
You do not have the required permissions to view the files attached to this post.