[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EL Question - Missing Data Condition



PureBytes Links

Trading Reference Links

> How do you detect missing data, with an IF statement ?
> Let's say we have Data1 and Data2.
> Data1 has data on every bar (so that the following code executes on every
> bar).
> I want to detect those bars on which Data2 is missing:
> 


I use the following code to show up to 8 missing bars. Of course, the
bars can not be seen as missing until after the fact. Change the +1, +2,
etc. to +5, +10, +15, etc. for 5 minute bar chart. Base the study on
Data1 or Data2 which ever one you want to check on or both.


if TimeToMinutes(T)>TimeToMinutes(T[1])+1 then 	plot1(h+.005*c,""); 	
if TimeToMinutes(T)>TimeToMinutes(T[1])+2 then 	plot2(h+.01*c,""); 
if TimeToMinutes(T)>TimeToMinutes(T[1])+3 then 	plot3(h+.015*c,""); 
if TimeToMinutes(T)>TimeToMinutes(T[1])+4 then	plot4(h+.02*c,""); 	


if TimeToMinutes(T)>TimeToMinutes(T[1])+5 then plot1(l-.005*c,""); 
if TimeToMinutes(T)>TimeToMinutes(T[1])+6 then plot2(l-.01*c,""); 
if TimeToMinutes(T)>TimeToMinutes(T[1])+7 then plot3(l-.015*c,""); 
if TimeToMinutes(T)>TimeToMinutes(T[1])+8 then plot4(l-.02*c,"");