...
2022.07.17 15:25:48.610 Core 01 2022.03.30 20:00:00 Incorrect input parameter InpAtrPeriod = 0. Indicator will use value 14 for calculations.
2022.07.17 15:25:48.610 Core 01 2022.03.30 20:00:00 Incorrect input parameter InpAtrPeriod = 0. Indicator will use value 14 for calculations.
...
//+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit(){ VerboseLog("--------------------------------------------------------"); VerboseLog("Starting the EA"); if(!checkComments()){ return(INIT_FAILED); } // OnInit rules //------------------------ // Rule: init //------------------------ // Action #1 TPp = AssignVrbVleEntMlt1; // Action #2 SLp = AssignVrbVleEntMlt2; // Action #3 TPm = AssignVrbVleEntMlt3; // Action #4 SLm = AssignVrbVleEntMlt4; // Action #5 BarsValid = AssignVrbVleEntMlt5; // Action #6 ExitAfterBars = AssignVrbVleEntMlt6; //Show all subchart symbols in market watch //initMagicNumber(); if(!initIndicators()) return(INIT_FAILED); gPointCoef = calculatePointCoef(Symbol()); //VerboseLog("Broker stop level: ", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL)); VerboseLog("--------------------------------------------------------"); if(sqDisplayInfoPanel) { sqInitInfoPanel(); } SQTime = new CSQTime();
if(_sqIsBarOpen == true){ // Action #1 TPp = AssignVrbVleEntMlt1; // Action #2 SLp = AssignVrbVleEntMlt2; // Action #3 TPm = AssignVrbVleEntMlt3; // Action #4 SLm = AssignVrbVleEntMlt4; // Action #5 BarsValid = AssignVrbVleEntMlt5; // Action #6 ExitAfterBars = AssignVrbVleEntMlt6; }
Also, the whole init rule code needs to be moved up to execute BEFORE initIndicators inside the OnInit function!