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

Re: supp/resis indicator



PureBytes Links

Trading Reference Links

Hello  bkmk,

b> I use 30 min bars and wonder if there is an indicator I can write that
b> will plot on today’s data but will draw horizontal lines for yesterday’s
b> high and low so I can use them as rudimentary supp/resis lines?

input:tyme(1),ptyme(0935);
Input: Near(1);
var:nextyme(0);
 
VALUE3=(HighYesterday+near);
VALUE1=HighYesterday;
VALUE5=(HighYesterday-near);
VALUE7=(HighYesterday-LowYesterday);
VALUE4=(LowYesterday+near);
VALUE2=LowYesterday;
VALUE6=(LowYesterday-near);
VALUE8=(CloseYesterday);
 
IF (TrueHigh >= VALUE5 and TrueLow <= VALUE3)THEN PLOT1(VALUE1,"YH");
IF (TrueHigh >= VALUE6 and TrueLow <= VALUE4)THEN PLOT2(VALUE2,"YL");


{all this other code below you do not need}




{
PLOT3(VALUE8,"CY");
}
IF CheckAlert Then Begin
  IF (TrueHigh >= VALUE1 and TrueLow <= VALUE1)
  or (TrueHigh >= VALUE2 and TrueLow <= VALUE2)
  or (TrueHigh >= VALUE3 and TrueLow <= VALUE3)
  or (TrueHigh >= VALUE4 and TrueLow <= VALUE4)
  or (TrueHigh >= VALUE5 and TrueLow <= VALUE5)
  or (TrueHigh >= VALUE6 and TrueLow <= VALUE6)
  Then Alert = TRUE;End;
 
if d>d[1]then nextyme=timetominutes(Sess1FirstBarTime)+tyme;
if timetominutes(t)>=nextyme then begin 
nextyme=nextyme+tyme;
 
if d=currentdate then begin
 
VALUE44=(truehigh+truelow)/2;
 
if (TrueHigh >= VALUE1 and TrueLow <= VALUE3)then 
PRINT(date:6:0, Time:5:0, "  HighYesterday + ", value1:4:4, "  Above + ", TrueLow:4:4,  "  C.N.#",commoditynumber:6:0);
 
if (TrueHigh >= VALUE1 and TrueLow <= VALUE1)then
PRINT(date:6:0, Time:5:0, "  HighYesterday = ", value1:4:4, "  Price = ", value44:4:4,  "  C.N.#",commoditynumber:6:0);
 
if (TrueHigh >= VALUE5 and TrueLow <= VALUE1)then
PRINT(date:6:0, Time:5:0, "  HighYesterday - ", value1:4:4, "  Below - ", TrueHigh:4:4,  "  C.N.#",commoditynumber:6:0);
 
if (TrueHigh >= VALUE2 and TrueLow <= VALUE4)then 
PRINT(date:6:0, Time:5:0, "  LowYesterday + ", value2:4:4, "  Above + ", TrueLow:4:4,  "  C.N.#",commoditynumber:6:0);
 
if (TrueHigh >= VALUE2 and TrueLow <= VALUE2)then  
PRINT(date:6:0, Time:5:0, "  LowYesterday = ", value2:4:4, "  Price = ", value44:4:4,  "  C.N.#",commoditynumber:6:0);
 
if (TrueHigh >= VALUE6 and TrueLow <= VALUE2)then 
PRINT(date:6:0, Time:5:0, "  LowYesterday - ", value2:4:4, "  Below - ", TrueHigh:4:4,  "  C.N.#",commoditynumber:6:0);
 
end;end;
 
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT( );end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT("-------Range Begin-------");end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT( );end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT(date:6:0, Time:5:0, "  HighYesterday=", value1:3:4,  "  C.N.  ",commoditynumber:6:0);end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT( );end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT(date:6:0, Time:5:0, "  RangeYesterday=", value7:3:4,  "  C.N.  ",commoditynumber:6:0);end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT( );end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT(date:6:0, Time:5:0, "  LowYesterday=", value2:3:4,  "  C.N.  ",commoditynumber:6:0);end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT( );end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT("-------Range End-------");end;end;
if d=currentdate then begin
IF t=ptyme and t[1]<ptyme then begin 
PRINT( );end;end;




--

Have a Great Day, Mark

http://www.markbrown.com