Job finished
Specification
2 sessions , 2 magics using the enclosed free indicators, fully commented . martingale , supports resistances using ma support and 4 hour daily support CANDLES .ADD 3 to 4 custom indicators :see list
Long entry : full 30 min bar LOW close above resistance on 4 h
short entry: full 30 min bar HIGH close below support on 4 h
Need price estimate to include ma filter
Code lwma filter
input bool UseLWMAFilter=true;(Before opening a trade ea will look for following filters for rising and falling , if above lwmas it is rising signal , if below lwmas it is falling signal.
if(UseLWMAFilter)
{
double _lwma8 = iMA(symbol, PERIOD_M30, 8, 0, MODE_LWMA, PRICE_CLOSE, 0);
double _lwma18 = iMA(symbol, PERIOD_M30, 18, 0, MODE_LWMA, PRICE_CLOSE, 0);
double _lwma30 = iMA(symbol, PERIOD_M30, 30, 0, MODE_LWMA, PRICE_CLOSE, 0);
if(_lwma8 <= _lwma18 || _lwma18 <= _lwma30) _short= true;
if(_lwma8 >= _lwma18 || _lwma18 >= _lwma30) _long = true;
double _lwma2 = iMA(symbol, PERIOD_M5, 2, 0, MODE_LWMA, PRICE_CLOSE, 0);
double _lwma60 = iMA(symbol, PERIOD_M5, 60, 0, MODE_LWMA, PRICE_CLOSE, 0);
double _lwma120 = iMA(symbol, PERIOD_M5, 120, 0, MODE_LWMA, PRICE_CLOSE, 0);
if(_lwma2 <= _lwma60 || _lwma60 <= _lwma120) _short = true;
if(_lwma2 >= _lwma60 || _lwma60 >= _lwma120) _long = true;
}
buy when resistance becomes support and support becomes resistance sell
need procoder /modular design (no hacks of mql5 for real accounts)
Don't like coders who take short cuts , as it is more expensive in long run
//--- Standard parameters
extern double Lots = 0.2;
extern double TradeMaxRisk = 2; // TradeMaxRisk > 0 so much % risk will be used, either based on SL or Account equity
extern bool AutoLot = false;
extern bool UseAdvancedMM = true;
extern double AdvancedMMPincrement = 33.0; // Increase 30% position after each loose
extern int AdvancedMMaxConsecutiveTrades = 35;
session1
extern int StopLossFirst1 = 600; // 0 deactivates Stop Loss
extern int StopLossSecond1 = 300;
extern bool AllowSecond = false;
extern int StartTrail1 = 250; // Start trail after so many pips.
extern int TrailingStop1 = 200; // 0 deactivates Trailing Stop
extern int TrailStep1 = 10; // With which increments TS moves
// Proportional stop
extern int PropStop1 = 500; // PropStop follows behind current price by X pips
extern int StartPosition1 = 370; // Pips profit at which to begin trailing with PropStop
extern double IncrementPercentage1 = 2; // Each pip of profit changes the PropStop value by X percent
extern int MinStopValue1 = 100; // PropStop cannot be less than X
extern int TakeProfit1 = 200; // 0 deactivates Take Profit
extern int GainForBE1 = 200; // How many pips will trigger Break Even. 0 deactivates.
extern int PipsBE1 = 20; // Level at which Break Even will be put
extern int StartTime1 = 100; // Start trading at 7:00
extern int StopTime1 = 800; // Stop trading at 23:00; Set to StartTime for continous operation (default).
extern int PipGap1 = 20; // Pip gap between first and second entry
extern int TimeGap1 = 30; // Time gap between first and second entry of 30 min
extern int PipsLongEntry1 = -10;
extern int PipsShortEntry1 = 10;
session2
extern int StopLossFirst2 = 300; // 0 deactivates Stop Loss
extern int StopLossSecond2 = 300;
extern int StartTrail2 = 350; // Start trail after so many pips.
extern int TrailingStop2 = 250; // 0 deactivates Trailing Stop
extern int TrailStep2 = 30; // With which increments TS moves
extern int PropStop2 = 500; // PropStop follows behind current price by X pips
extern int StartPosition2 = 1650; // Pips profit at which to begin trailing with PropStop
extern double IncrementPercentage2 = 2; // Each pip of profit changes the PropStop value by X percent
extern int MinStopValue2 = 100; // PropStop cannot be less than X
extern int TakeProfit2 = 200; // 0 deactivates Take Profit
extern int GainForBE2 = 300; // How many pips will trigger Break Even. 0 deactivates.
extern int PipsBE2 = 20; // Level at which Break Even will be put
extern int StartTime2 = 900; // Start trading at 7:00
extern int StopTime2 = 1800; // Stop trading at 23:00; Set to StartTime for continous operation (default).
extern int PipGap2 = 100; // Pip gap between first and second entry
extern int TimeGap2 = 30; // Time gap between first and second entry of 30 min
extern int PipsLongEntry2 = -20;
extern int PipsShortEntry2 = 20;
extern string closing="==== Close Times ====";
extern bool CloseOnTime = true;
extern int ClosingTime = 1900;
extern bool EnableExitManager = true;
extern double OldSwapLong = 1.0;
extern double OldSwapShort = -1.0;
extern int RangeDeviation = 1;
extern bool UseProbCountsFilter = false;
extern bool UseMSSIFilter = false;
extern bool UsePriceFilter = true;
extern bool UseLWMAFilter = false;
extern int MinimumPreviousRange = 20;
extern string NameLogFile="logMC";
extern string NameLogFile2="logMC3";
extern bool UsejoyFilter = false;
extern int joysell = -20;
extern int joybuy = 20;
extern bool UseStochtb15mfilter=false;
extern int StochUpperLevel=20;
extern int StochLowerLevel=-20;
extern bool UseSMSIPT1=true;
extern int MSIPT1UpperLevel=20;
extern int MSIPT1LowerLevel=-20;
extern bool Disable_Comments = false; // EA will not display comments on screen
//---- Debugging
extern bool DoScreenShots = true; // Makes screen shots when a trade is open
extern int ExpertID1 = 28105;
extern int ExpertID2 = 28106;