Turn Denmark Pivot into a scanner?

C

Craighaber71

Active member
2019 Donor
VIP
Looking for help turning the Denmark Pivots into an intraday scan..It works on the daily but anything less gets an error..Looking for the close Above resistance or below support..

Code:
# Demark's Pivots
# Ported to TOS by Mobius
# useful as boundaries for intraday likely moves
declare hide_on_daily;

def o = open(period = AggregationPeriod.day)[1];
def h = high(period = AggregationPeriod.day)[1];
def l = low(period = AggregationPeriod.day)[1];
def c = close(period = AggregationPeriod.day)[1];
def x = if c < o
        then h + (2 * l) + c
        else if c > o
             then (2 * h) + l + c
             else if c == o
                  then h + l + (2 * c)
                  else x[1];
plot Pivot_Point = X/4;
Pivot_Point.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Pivot_Point.setDefaultColor(GetColor(8));
Pivot_Point.SetLineWeight(2);
plot Support = X/2 - h;
Support.SetPaintingStrategy(PaintingStrategy.Horizontal);
#Support.setDefaultColor(GetColor(1));
Support. SetDefaultColor(CreateColor(0, 0, 204));
Support.SetLineWeight(3);
plot Resistance = X/2 - l;
Resistance.SetPaintingStrategy(PaintingStrategy.Horizontal);
#Resistance.setDefaultColor(GetColor(0));
Resistance. SetDefaultColor(CreateColor(153, 0, 51));
Resistance.SetLineWeight(3);
# End Code
 
Last edited by a moderator:

Similar threads

Top