diff --git a/Experts/Nkanven/TheChallenger.ex5 b/Experts/Nkanven/TheChallenger.ex5 index 546b5bf..e073faa 100644 Binary files a/Experts/Nkanven/TheChallenger.ex5 and b/Experts/Nkanven/TheChallenger.ex5 differ diff --git a/Experts/Nkanven/TheChallenger.mq5 b/Experts/Nkanven/TheChallenger.mq5 index 42edbe7..dfcf95a 100644 --- a/Experts/Nkanven/TheChallenger.mq5 +++ b/Experts/Nkanven/TheChallenger.mq5 @@ -20,6 +20,7 @@ #include #include CiMA* ma; +CiMA* maHT; CiATR* atr; //+------------------------------------------------------------------+ @@ -29,10 +30,13 @@ int OnInit() { //--- ma = new CiMA(); - ma.Create(gSymbol, PERIOD_CURRENT, InpPeriods, InpAppliedPrice, InpMethod, PRICE_CLOSE); + ma.Create(gSymbol, InpTimeFrame, InpPeriods, InpAppliedPrice, InpMethod, PRICE_CLOSE); + + maHT = new CiMA(); + maHT.Create(gSymbol, InpHtTimeframe, InpHtPeriods, InpHtAppliedPrice, InpHtMethod, PRICE_CLOSE); atr = new CiATR(); - atr.Create(gSymbol, PERIOD_CURRENT, InpAtrPeriod); + atr.Create(gSymbol, InpTimeFrame, InpAtrPeriod); //--- return(INIT_SUCCEEDED); } @@ -53,6 +57,8 @@ void OnTick() TimeCurrent(dt); SymbolInfoTick(_Symbol,last_tick); + + //isPinBar(); CheckOperationHours(); CheckPreChecks(); @@ -64,12 +70,17 @@ void OnTick() atr.Refresh(-1); gAtr = atr.Main(1); + maHT.Refresh(-1); + gHtMa = maHT.Main(1); + Print("ATR ", gAtr); + Comment("gHtMa ", gHtMa); if(!gIsPreChecksOk) return; Print("Good for trading..."); + getSignal(); ExecuteEntry(); } diff --git a/Include/Nkanven/TheChallenger/EntriesManager.mqh b/Include/Nkanven/TheChallenger/EntriesManager.mqh index 9070bdf..cf4faf4 100644 Binary files a/Include/Nkanven/TheChallenger/EntriesManager.mqh and b/Include/Nkanven/TheChallenger/EntriesManager.mqh differ diff --git a/Include/Nkanven/TheChallenger/Parameters.mqh b/Include/Nkanven/TheChallenger/Parameters.mqh index 204dc77..d925249 100644 --- a/Include/Nkanven/TheChallenger/Parameters.mqh +++ b/Include/Nkanven/TheChallenger/Parameters.mqh @@ -97,6 +97,11 @@ input int InpPeriods = 21; //Fast periods input ENUM_MA_METHOD InpMethod = MODE_SMA; //Fast method input ENUM_APPLIED_PRICE InpAppliedPrice = PRICE_CLOSE; //Fast price +input int InpHtPeriods = 21; //Higher TF periods +input ENUM_MA_METHOD InpHtMethod = MODE_SMA; //Higher TF method +input ENUM_APPLIED_PRICE InpHtAppliedPrice = PRICE_CLOSE; //Higher TF price +input ENUM_TIMEFRAMES InpHtTimeframe = PERIOD_CURRENT; //Timeframe + // Average True Range input int InpAtrPeriod = 14; //ATR period input int InpAtrMultiplier = 3; //ATR multiplier @@ -110,9 +115,13 @@ input int InpNightTradingHourStart=1; //Night Trading Start Hou input int InpNightTradingHourEnd=5; //Night Trading End Hour (Broker Server Hour) input string InpComment = __FILE__; //Default trade comment input int InpMagicNumber = 198901; //Magic Number +input ENUM_TIMEFRAMES InpTimeFrame = PERIOD_CURRENT; + +input double InpMinCandleLenght = 25.0; //Min candle length +input int InpCandleWickPercent = 75; //Candle wick percent string gSymbol = Symbol(); -double gAtr, gMa; +double gAtr, gMa, gHtMa; int gTotalSellPositions, gTotalBuyPositions, gTotalPositions; bool gIsOperatingHours=false; diff --git a/Include/Nkanven/TheChallenger/TradeManager.mqh b/Include/Nkanven/TheChallenger/TradeManager.mqh index 3bf43bd..e69de29 100644 --- a/Include/Nkanven/TheChallenger/TradeManager.mqh +++ b/Include/Nkanven/TheChallenger/TradeManager.mqh @@ -1,27 +0,0 @@ -//+------------------------------------------------------------------+ -//| TradeManager.mqh | -//| Copyright 2021, Nkondog Anselme Venceslas | -//| https://www.mql5.com | -//+------------------------------------------------------------------+ -#property copyright "Copyright 2021, Nkondog Anselme Venceslas" -#property link "https://www.mql5.com" -//+------------------------------------------------------------------+ -//| defines | -//+------------------------------------------------------------------+ -// #define MacrosHello "Hello, world!" -// #define MacrosYear 2010 -//+------------------------------------------------------------------+ -//| DLL imports | -//+------------------------------------------------------------------+ -// #import "user32.dll" -// int SendMessageA(int hWnd,int Msg,int wParam,int lParam); -// #import "my_expert.dll" -// int ExpertRecalculate(int wParam,int lParam); -// #import -//+------------------------------------------------------------------+ -//| EX5 imports | -//+------------------------------------------------------------------+ -// #import "stdlib.ex5" -// string ErrorDescription(int error_code); -// #import -//+------------------------------------------------------------------+