//+------------------------------------------------------------------+ //| ATR Marks.mq4 | //| Bill Jones | //| Colorado Springs, CO | //+------------------------------------------------------------------+ #property copyright "2014 - Bill Jones" #property indicator_chart_window //---- input int ATRPeriod=14; // ATR Period Parameter //---- double H4,L4,fullatr,shiftnbr; int dayshift,dayshiftold=-1; int NbrDigits; bool ErrFlag=true; // True = print an error datetime OldBar=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { ObjectDelete("ATRHigh Line"); ObjectDelete("ATRLow Line"); ObjectDelete("ATR Label"); ObjectDelete("ATRDay Line"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { if(IndicatorCounted() < 1) return(0); if(Time[0] == OldBar) return(0); OldBar=Time[0]; //---- if(Period()>1440) // Day chart is the largest to display values on. { if(ErrFlag) { ErrFlag=false; Print("Error - Chart period is greater than 1 day."); } return(-1); // then exit } NbrDigits=Digits-1; // Digits must be either 3 or 5. 2 & 4 Digit accounts do not work here. if(NbrDigits>2) shiftnbr=10000; else shiftnbr=100; int BarsPerChart=WindowBarsPerChart()-5; // Don't check all of the bars dayshift=0; while(dayshift