first script based on Volume Profile POC

msmmlee

New member
Plus
Hello... I need help with a script that will add two lines to the Volume Profile indicator that is set on the hourly "time per profile" setting without the expansion turned on. One line will be .10 above the Point of Control and another will be .10 below POC - I'm basically trying to create POC highs and lows similar to how the indicator has the VA High and VA Low. I have found in the Thinkscript tutorials how to reference a study, but it doesn't get specific enough to show how to reference the hourly and no expansion settings.
 
Solution
Thanks for responding. I added your suggestions in as follows but still didn't see the new POC high & low lines so then I also added in the two "SetPaintingStrategy" lines below like the other lines in the profile have in case those needed to be set up as well. I still don't see the new lines on my chart though... is there anything else I need to do?

plot POCHigh = POC+(POC*.20);
plot POCLow = POC-POC*.20;


POCHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
POCLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

This might help. It defines POC through a reference to the TOS volumeprofile(). You can adjust the percent high/low at the input screen.

Screenshot-2023-01-15-070200.png
Ruby:
input percent = 1.0;
plot POC = reference...
Thanks for responding. I added your suggestions in as follows but still didn't see the new POC high & low lines so then I also added in the two "SetPaintingStrategy" lines below like the other lines in the profile have in case those needed to be set up as well. I still don't see the new lines on my chart though... is there anything else I need to do?

plot POCHigh = POC+(POC*.20);
plot POCLow = POC-POC*.20;


POCHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
POCLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

This might help. It defines POC through a reference to the TOS volumeprofile(). You can adjust the percent high/low at the input screen.

Screenshot-2023-01-15-070200.png
Ruby:
input percent = 1.0;
plot POC = reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "HOUR", "on expansion" = no);
plot POCHigh = POC + (POC * percent / 100);
plot POCLow  = POC - (POC * percent / 100);
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
POCHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
POCLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
POC.SetLineWeight(5);
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

This might help. It defines POC through a reference to the TOS volumeprofile(). You can adjust the percent high/low at the input screen.

This POC is updating every one hour. I see some POC's are keep on update every few minutes as volume comes. If possible, can you help on this.
 
This POC is updating every one hour. I see some POC's are keep on update every few minutes as volume comes. If possible, can you help on this.

This will plot the volumeprofile on a bar by bar basis. It has 98 iterations. For smaller agg charts (1m-3m), use the autostart, start_type to ensure that these plot for the entire rthrs. For all other aggs, the manualstart should work. It is resource intensive and may not work for all computer setups.

Screenshot 2024-03-15 142557.png
Code:
#VolumeProfile_bar_by_bar_Flexible_98_Iterations

#POC
#VolumeProfile_78_bar_by_bar

# plots POC, VAH and VAL for profiles starting at RTH Open and ending 1,2,3 etc bars later
# Not a realistic solution to the problem
# Nube
# 20220712 Sleepyz - Modified Nube's (TOS lounge) script to add additional else if statements to allow this to track these 3 variables on 5m and greater intraday periods. This can be very resource intense

input start_type   = {default autostart, manualstart};
input manual_start = 0;

def bn = BarNumber();
def na = Double.NaN;

script TestPro {
    input Start = 1;
    input nBars = 0;
    def bn    = BarNumber();
    def na    = Double.NaN;
    def EndBar        = if   bn == Start + nBars
                        then bn else EndBar[1];
    def NewProfile    = bn == Start or
                        bn crosses above EndBar;

    profile testProfile = volumeProfile("startNewProfile" = NewProfile
, "onExpansion" = no, "numberOfProfiles" = 99, "pricePerRow" = TickSize(), "value area percent" = 70);

    plot hva = if   bn == EndBar
           then testProfile.GetHighestValueArea()
           else na;
    plot lva = if   bn == EndBar
           then testProfile.GetLowestValueArea()
           else na;
    plot poc = if   bn == EndBar
           then testProfile.GetPointOfControl()
           else na;
}
def RTHOpen = GetDay() == GetLastDay()  &&
              GetTime() crosses above RegularTradingStart(GetYYYYMMDD());

def RTHBar  = HighestAll(CompoundValue(1,
              if RTHOpen
              then bn - 1
              else Double.NaN, 0));

def count = if bn < RTHBar or
            GetTime() > RegularTradingEnd(GetYYYYMMDD())
            then 0
            else if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())
            then 1
            else if GetTime() < RegularTradingEnd(GetYYYYMMDD()) then count[1] + 1
            else Double.NaN
            ;

def move  = if bn < RTHBar or
            GetTime() > RegularTradingEnd(GetYYYYMMDD())
            then 0
            else if Between(count, 1, 60)
            then 0
            else if Between(count, 61, 292)
            then count - 89
            else 292
            ;


def start = if start_type == start_type.manualstart
            then manual_start
            else if start_type == start_type.autostart
                 then if bn < RTHBar or
                         GetTime() > RegularTradingEnd(GetYYYYMMDD())
            then 0
            else HighestAll(GetValue(AbsValue(move), 1))
            else 0;


def hva =
if  bn == RTHBar + start + 1 then TestPro(RTHBar,  start + 1).hva else
if  bn == RTHBar + start + 2 then TestPro(RTHBar,  start + 2).hva else
if  bn == RTHBar + start + 3 then TestPro(RTHBar,  start + 3).hva else
if  bn == RTHBar + start + 4 then TestPro(RTHBar,  start + 4).hva else
if  bn == RTHBar + start + 5 then TestPro(RTHBar,  start + 5).hva else
if  bn == RTHBar + start + 6 then TestPro(RTHBar,  start + 6).hva else
if  bn == RTHBar + start + 7 then TestPro(RTHBar,  start + 7).hva else
if  bn == RTHBar + start + 8 then TestPro(RTHBar,  start + 8).hva else
if  bn == RTHBar + start + 9 then TestPro(RTHBar,  start + 9).hva else
if  bn == RTHBar + start + 10 then TestPro(RTHBar,  start + 10).hva else
if  bn == RTHBar + start + 11 then TestPro(RTHBar,  start + 11).hva else
if  bn == RTHBar + start + 12 then TestPro(RTHBar,  start + 12).hva else
if  bn == RTHBar + start + 13 then TestPro(RTHBar,  start + 13).hva else
if  bn == RTHBar + start + 14 then TestPro(RTHBar,  start + 14).hva else
if  bn == RTHBar + start + 15 then TestPro(RTHBar,  start + 15).hva else
if  bn == RTHBar + start + 16 then TestPro(RTHBar,  start + 16).hva else
if  bn == RTHBar + start + 17 then TestPro(RTHBar,  start + 17).hva else
if  bn == RTHBar + start + 18 then TestPro(RTHBar,  start + 18).hva else
if  bn == RTHBar + start + 19 then TestPro(RTHBar,  start + 19).hva else
if  bn == RTHBar + start + 20 then TestPro(RTHBar,  start + 20).hva else
if  bn == RTHBar + start + 21 then TestPro(RTHBar,  start + 21).hva else
if  bn == RTHBar + start + 22 then TestPro(RTHBar,  start + 22).hva else
if  bn == RTHBar + start + 23 then TestPro(RTHBar,  start + 23).hva else
if  bn == RTHBar + start + 24 then TestPro(RTHBar,  start + 24).hva else
if  bn == RTHBar + start + 25 then TestPro(RTHBar,  start + 25).hva else
if  bn == RTHBar + start + 26 then TestPro(RTHBar,  start + 26).hva else
if  bn == RTHBar + start + 27 then TestPro(RTHBar,  start + 27).hva else
if  bn == RTHBar + start + 28 then TestPro(RTHBar,  start + 28).hva else
if  bn == RTHBar + start + 29 then TestPro(RTHBar,  start + 29).hva else
if  bn == RTHBar + start + 30 then TestPro(RTHBar,  start + 30).hva else
if  bn == RTHBar + start + 31 then TestPro(RTHBar,  start + 31).hva else
if  bn == RTHBar + start + 32 then TestPro(RTHBar,  start + 32).hva else
if  bn == RTHBar + start + 33 then TestPro(RTHBar,  start + 33).hva else
if  bn == RTHBar + start + 34 then TestPro(RTHBar,  start + 34).hva else
if  bn == RTHBar + start + 35 then TestPro(RTHBar,  start + 35).hva else
if  bn == RTHBar + start + 36 then TestPro(RTHBar,  start + 36).hva else
if  bn == RTHBar + start + 37 then TestPro(RTHBar,  start + 37).hva else
if  bn == RTHBar + start + 38 then TestPro(RTHBar,  start + 38).hva else
if  bn == RTHBar + start + 39 then TestPro(RTHBar,  start + 39).hva else
if  bn == RTHBar + start + 40 then TestPro(RTHBar,  start + 40).hva else
if  bn == RTHBar + start + 41 then TestPro(RTHBar,  start + 41).hva else
if  bn == RTHBar + start + 42 then TestPro(RTHBar,  start + 42).hva else
if  bn == RTHBar + start + 43 then TestPro(RTHBar,  start + 43).hva else
if  bn == RTHBar + start + 44 then TestPro(RTHBar,  start + 44).hva else
if  bn == RTHBar + start + 45 then TestPro(RTHBar,  start + 45).hva else
if  bn == RTHBar + start + 46 then TestPro(RTHBar,  start + 46).hva else
if  bn == RTHBar + start + 47 then TestPro(RTHBar,  start + 47).hva else
if  bn == RTHBar + start + 48 then TestPro(RTHBar,  start + 48).hva else
if  bn == RTHBar + start + 49 then TestPro(RTHBar,  start + 49).hva else
if  bn == RTHBar + start + 50 then TestPro(RTHBar,  start + 50).hva else
if  bn == RTHBar + start + 51 then TestPro(RTHBar,  start + 51).hva else
if  bn == RTHBar + start + 52 then TestPro(RTHBar,  start + 52).hva else
if  bn == RTHBar + start + 53 then TestPro(RTHBar,  start + 53).hva else
if  bn == RTHBar + start + 54 then TestPro(RTHBar,  start + 54).hva else
if  bn == RTHBar + start + 55 then TestPro(RTHBar,  start + 55).hva else
if  bn == RTHBar + start + 56 then TestPro(RTHBar,  start + 56).hva else
if  bn == RTHBar + start + 57 then TestPro(RTHBar,  start + 57).hva else
if  bn == RTHBar + start + 58 then TestPro(RTHBar,  start + 58).hva else
if  bn == RTHBar + start + 59 then TestPro(RTHBar,  start + 59).hva else
if  bn == RTHBar + start + 60 then TestPro(RTHBar,  start + 60).hva else
if  bn == RTHBar + start + 61 then TestPro(RTHBar,  start + 61).hva else
if  bn == RTHBar + start + 62 then TestPro(RTHBar,  start + 62).hva else
if  bn == RTHBar + start + 63 then TestPro(RTHBar,  start + 63).hva else
if  bn == RTHBar + start + 64 then TestPro(RTHBar,  start + 64).hva else
if  bn == RTHBar + start + 65 then TestPro(RTHBar,  start + 65).hva else
if  bn == RTHBar + start + 66 then TestPro(RTHBar,  start + 66).hva else
if  bn == RTHBar + start + 67 then TestPro(RTHBar,  start + 67).hva else
if  bn == RTHBar + start + 68 then TestPro(RTHBar,  start + 68).hva else
if  bn == RTHBar + start + 69 then TestPro(RTHBar,  start + 69).hva else
if  bn == RTHBar + start + 70 then TestPro(RTHBar,  start + 70).hva else
if  bn == RTHBar + start + 71 then TestPro(RTHBar,  start + 71).hva else
if  bn == RTHBar + start + 72 then TestPro(RTHBar,  start + 72).hva else
if  bn == RTHBar + start + 73 then TestPro(RTHBar,  start + 73).hva else
if  bn == RTHBar + start + 74 then TestPro(RTHBar,  start + 74).hva else
if  bn == RTHBar + start + 75 then TestPro(RTHBar,  start + 75).hva else
if  bn == RTHBar + start + 76 then TestPro(RTHBar,  start + 76).hva else
if  bn == RTHBar + start + 77 then TestPro(RTHBar,  start + 77).hva else
if  bn == RTHBar + start + 78 then TestPro(RTHBar,  start + 78).hva else
if  bn == RTHBar + start + 79 then TestPro(RTHBar,  start + 79).hva else
if  bn == RTHBar + start + 80 then TestPro(RTHBar,  start + 80).hva else
if  bn == RTHBar + start + 81 then TestPro(RTHBar,  start + 81).hva else
if  bn == RTHBar + start + 82 then TestPro(RTHBar,  start + 82).hva else
if  bn == RTHBar + start + 83 then TestPro(RTHBar,  start + 83).hva else
if  bn == RTHBar + start + 84 then TestPro(RTHBar,  start + 84).hva else
if  bn == RTHBar + start + 85 then TestPro(RTHBar,  start + 85).hva else
if  bn == RTHBar + start + 86 then TestPro(RTHBar,  start + 86).hva else
if  bn == RTHBar + start + 87 then TestPro(RTHBar,  start + 87).hva else
if  bn == RTHBar + start + 88 then TestPro(RTHBar,  start + 88).hva else
if  bn == RTHBar + start + 89 then TestPro(RTHBar,  start + 89).hva else
if  bn == RTHBar + start + 90 then TestPro(RTHBar,  start + 90).hva else
if  bn == RTHBar + start + 91 then TestPro(RTHBar,  start + 91).hva else
if  bn == RTHBar + start + 92 then TestPro(RTHBar,  start + 92).hva else
if  bn == RTHBar + start + 93 then TestPro(RTHBar,  start + 93).hva else
if  bn == RTHBar + start + 94 then TestPro(RTHBar,  start + 94).hva else
if  bn == RTHBar + start + 95 then TestPro(RTHBar,  start + 95).hva else
if  bn == RTHBar + start + 96 then TestPro(RTHBar,  start + 96).hva else
if  bn == RTHBar + start + 97 then TestPro(RTHBar,  start + 97).hva else
if  bn == RTHBar + start + 98 then TestPro(RTHBar,  start + 98).hva else
na;

def lva =
if  bn == RTHBar + start + 1 then TestPro(RTHBar,  start + 1).lva else
if  bn == RTHBar + start + 2 then TestPro(RTHBar,  start + 2).lva else
if  bn == RTHBar + start + 3 then TestPro(RTHBar,  start + 3).lva else
if  bn == RTHBar + start + 4 then TestPro(RTHBar,  start + 4).lva else
if  bn == RTHBar + start + 5 then TestPro(RTHBar,  start + 5).lva else
if  bn == RTHBar + start + 6 then TestPro(RTHBar,  start + 6).lva else
if  bn == RTHBar + start + 7 then TestPro(RTHBar,  start + 7).lva else
if  bn == RTHBar + start + 8 then TestPro(RTHBar,  start + 8).lva else
if  bn == RTHBar + start + 9 then TestPro(RTHBar,  start + 9).lva else
if  bn == RTHBar + start + 10 then TestPro(RTHBar,  start + 10).lva else
if  bn == RTHBar + start + 11 then TestPro(RTHBar,  start + 11).lva else
if  bn == RTHBar + start + 12 then TestPro(RTHBar,  start + 12).lva else
if  bn == RTHBar + start + 13 then TestPro(RTHBar,  start + 13).lva else
if  bn == RTHBar + start + 14 then TestPro(RTHBar,  start + 14).lva else
if  bn == RTHBar + start + 15 then TestPro(RTHBar,  start + 15).lva else
if  bn == RTHBar + start + 16 then TestPro(RTHBar,  start + 16).lva else
if  bn == RTHBar + start + 17 then TestPro(RTHBar,  start + 17).lva else
if  bn == RTHBar + start + 18 then TestPro(RTHBar,  start + 18).lva else
if  bn == RTHBar + start + 19 then TestPro(RTHBar,  start + 19).lva else
if  bn == RTHBar + start + 20 then TestPro(RTHBar,  start + 20).lva else
if  bn == RTHBar + start + 21 then TestPro(RTHBar,  start + 21).lva else
if  bn == RTHBar + start + 22 then TestPro(RTHBar,  start + 22).lva else
if  bn == RTHBar + start + 23 then TestPro(RTHBar,  start + 23).lva else
if  bn == RTHBar + start + 24 then TestPro(RTHBar,  start + 24).lva else
if  bn == RTHBar + start + 25 then TestPro(RTHBar,  start + 25).lva else
if  bn == RTHBar + start + 26 then TestPro(RTHBar,  start + 26).lva else
if  bn == RTHBar + start + 27 then TestPro(RTHBar,  start + 27).lva else
if  bn == RTHBar + start + 28 then TestPro(RTHBar,  start + 28).lva else
if  bn == RTHBar + start + 29 then TestPro(RTHBar,  start + 29).lva else
if  bn == RTHBar + start + 30 then TestPro(RTHBar,  start + 30).lva else
if  bn == RTHBar + start + 31 then TestPro(RTHBar,  start + 31).lva else
if  bn == RTHBar + start + 32 then TestPro(RTHBar,  start + 32).lva else
if  bn == RTHBar + start + 33 then TestPro(RTHBar,  start + 33).lva else
if  bn == RTHBar + start + 34 then TestPro(RTHBar,  start + 34).lva else
if  bn == RTHBar + start + 35 then TestPro(RTHBar,  start + 35).lva else
if  bn == RTHBar + start + 36 then TestPro(RTHBar,  start + 36).lva else
if  bn == RTHBar + start + 37 then TestPro(RTHBar,  start + 37).lva else
if  bn == RTHBar + start + 38 then TestPro(RTHBar,  start + 38).lva else
if  bn == RTHBar + start + 39 then TestPro(RTHBar,  start + 39).lva else
if  bn == RTHBar + start + 40 then TestPro(RTHBar,  start + 40).lva else
if  bn == RTHBar + start + 41 then TestPro(RTHBar,  start + 41).lva else
if  bn == RTHBar + start + 42 then TestPro(RTHBar,  start + 42).lva else
if  bn == RTHBar + start + 43 then TestPro(RTHBar,  start + 43).lva else
if  bn == RTHBar + start + 44 then TestPro(RTHBar,  start + 44).lva else
if  bn == RTHBar + start + 45 then TestPro(RTHBar,  start + 45).lva else
if  bn == RTHBar + start + 46 then TestPro(RTHBar,  start + 46).lva else
if  bn == RTHBar + start + 47 then TestPro(RTHBar,  start + 47).lva else
if  bn == RTHBar + start + 48 then TestPro(RTHBar,  start + 48).lva else
if  bn == RTHBar + start + 49 then TestPro(RTHBar,  start + 49).lva else
if  bn == RTHBar + start + 50 then TestPro(RTHBar,  start + 50).lva else
if  bn == RTHBar + start + 51 then TestPro(RTHBar,  start + 51).lva else
if  bn == RTHBar + start + 52 then TestPro(RTHBar,  start + 52).lva else
if  bn == RTHBar + start + 53 then TestPro(RTHBar,  start + 53).lva else
if  bn == RTHBar + start + 54 then TestPro(RTHBar,  start + 54).lva else
if  bn == RTHBar + start + 55 then TestPro(RTHBar,  start + 55).lva else
if  bn == RTHBar + start + 56 then TestPro(RTHBar,  start + 56).lva else
if  bn == RTHBar + start + 57 then TestPro(RTHBar,  start + 57).lva else
if  bn == RTHBar + start + 58 then TestPro(RTHBar,  start + 58).lva else
if  bn == RTHBar + start + 59 then TestPro(RTHBar,  start + 59).lva else
if  bn == RTHBar + start + 60 then TestPro(RTHBar,  start + 60).lva else
if  bn == RTHBar + start + 61 then TestPro(RTHBar,  start + 61).lva else
if  bn == RTHBar + start + 62 then TestPro(RTHBar,  start + 62).lva else
if  bn == RTHBar + start + 63 then TestPro(RTHBar,  start + 63).lva else
if  bn == RTHBar + start + 64 then TestPro(RTHBar,  start + 64).lva else
if  bn == RTHBar + start + 65 then TestPro(RTHBar,  start + 65).lva else
if  bn == RTHBar + start + 66 then TestPro(RTHBar,  start + 66).lva else
if  bn == RTHBar + start + 67 then TestPro(RTHBar,  start + 67).lva else
if  bn == RTHBar + start + 68 then TestPro(RTHBar,  start + 68).lva else
if  bn == RTHBar + start + 69 then TestPro(RTHBar,  start + 69).lva else
if  bn == RTHBar + start + 70 then TestPro(RTHBar,  start + 70).lva else
if  bn == RTHBar + start + 71 then TestPro(RTHBar,  start + 71).lva else
if  bn == RTHBar + start + 72 then TestPro(RTHBar,  start + 72).lva else
if  bn == RTHBar + start + 73 then TestPro(RTHBar,  start + 73).lva else
if  bn == RTHBar + start + 74 then TestPro(RTHBar,  start + 74).lva else
if  bn == RTHBar + start + 75 then TestPro(RTHBar,  start + 75).lva else
if  bn == RTHBar + start + 76 then TestPro(RTHBar,  start + 76).lva else
if  bn == RTHBar + start + 77 then TestPro(RTHBar,  start + 77).lva else
if  bn == RTHBar + start + 78 then TestPro(RTHBar,  start + 78).lva else
if  bn == RTHBar + start + 79 then TestPro(RTHBar,  start + 79).lva else
if  bn == RTHBar + start + 80 then TestPro(RTHBar,  start + 80).lva else
if  bn == RTHBar + start + 81 then TestPro(RTHBar,  start + 81).lva else
if  bn == RTHBar + start + 82 then TestPro(RTHBar,  start + 82).lva else
if  bn == RTHBar + start + 83 then TestPro(RTHBar,  start + 83).lva else
if  bn == RTHBar + start + 84 then TestPro(RTHBar,  start + 84).lva else
if  bn == RTHBar + start + 85 then TestPro(RTHBar,  start + 85).lva else
if  bn == RTHBar + start + 86 then TestPro(RTHBar,  start + 86).lva else
if  bn == RTHBar + start + 87 then TestPro(RTHBar,  start + 87).lva else
if  bn == RTHBar + start + 88 then TestPro(RTHBar,  start + 88).lva else
if  bn == RTHBar + start + 89 then TestPro(RTHBar,  start + 89).lva else
if  bn == RTHBar + start + 90 then TestPro(RTHBar,  start + 90).lva else
if  bn == RTHBar + start + 91 then TestPro(RTHBar,  start + 91).lva else
if  bn == RTHBar + start + 92 then TestPro(RTHBar,  start + 92).lva else
if  bn == RTHBar + start + 93 then TestPro(RTHBar,  start + 93).lva else
if  bn == RTHBar + start + 94 then TestPro(RTHBar,  start + 94).lva else
if  bn == RTHBar + start + 95 then TestPro(RTHBar,  start + 95).lva else
if  bn == RTHBar + start + 96 then TestPro(RTHBar,  start + 96).lva else
if  bn == RTHBar + start + 97 then TestPro(RTHBar,  start + 97).lva else
if  bn == RTHBar + start + 98 then TestPro(RTHBar,  start + 98).lva else
na;

def poc =
if  bn == RTHBar + start + 1 then TestPro(RTHBar,  start + 1).poc else
if  bn == RTHBar + start + 2 then TestPro(RTHBar,  start + 2).poc else
if  bn == RTHBar + start + 3 then TestPro(RTHBar,  start + 3).poc else
if  bn == RTHBar + start + 4 then TestPro(RTHBar,  start + 4).poc else
if  bn == RTHBar + start + 5 then TestPro(RTHBar,  start + 5).poc else
if  bn == RTHBar + start + 6 then TestPro(RTHBar,  start + 6).poc else
if  bn == RTHBar + start + 7 then TestPro(RTHBar,  start + 7).poc else
if  bn == RTHBar + start + 8 then TestPro(RTHBar,  start + 8).poc else
if  bn == RTHBar + start + 9 then TestPro(RTHBar,  start + 9).poc else
if  bn == RTHBar + start + 10 then TestPro(RTHBar,  start + 10).poc else
if  bn == RTHBar + start + 11 then TestPro(RTHBar,  start + 11).poc else
if  bn == RTHBar + start + 12 then TestPro(RTHBar,  start + 12).poc else
if  bn == RTHBar + start + 13 then TestPro(RTHBar,  start + 13).poc else
if  bn == RTHBar + start + 14 then TestPro(RTHBar,  start + 14).poc else
if  bn == RTHBar + start + 15 then TestPro(RTHBar,  start + 15).poc else
if  bn == RTHBar + start + 16 then TestPro(RTHBar,  start + 16).poc else
if  bn == RTHBar + start + 17 then TestPro(RTHBar,  start + 17).poc else
if  bn == RTHBar + start + 18 then TestPro(RTHBar,  start + 18).poc else
if  bn == RTHBar + start + 19 then TestPro(RTHBar,  start + 19).poc else
if  bn == RTHBar + start + 20 then TestPro(RTHBar,  start + 20).poc else
if  bn == RTHBar + start + 21 then TestPro(RTHBar,  start + 21).poc else
if  bn == RTHBar + start + 22 then TestPro(RTHBar,  start + 22).poc else
if  bn == RTHBar + start + 23 then TestPro(RTHBar,  start + 23).poc else
if  bn == RTHBar + start + 24 then TestPro(RTHBar,  start + 24).poc else
if  bn == RTHBar + start + 25 then TestPro(RTHBar,  start + 25).poc else
if  bn == RTHBar + start + 26 then TestPro(RTHBar,  start + 26).poc else
if  bn == RTHBar + start + 27 then TestPro(RTHBar,  start + 27).poc else
if  bn == RTHBar + start + 28 then TestPro(RTHBar,  start + 28).poc else
if  bn == RTHBar + start + 29 then TestPro(RTHBar,  start + 29).poc else
if  bn == RTHBar + start + 30 then TestPro(RTHBar,  start + 30).poc else
if  bn == RTHBar + start + 31 then TestPro(RTHBar,  start + 31).poc else
if  bn == RTHBar + start + 32 then TestPro(RTHBar,  start + 32).poc else
if  bn == RTHBar + start + 33 then TestPro(RTHBar,  start + 33).poc else
if  bn == RTHBar + start + 34 then TestPro(RTHBar,  start + 34).poc else
if  bn == RTHBar + start + 35 then TestPro(RTHBar,  start + 35).poc else
if  bn == RTHBar + start + 36 then TestPro(RTHBar,  start + 36).poc else
if  bn == RTHBar + start + 37 then TestPro(RTHBar,  start + 37).poc else
if  bn == RTHBar + start + 38 then TestPro(RTHBar,  start + 38).poc else
if  bn == RTHBar + start + 39 then TestPro(RTHBar,  start + 39).poc else
if  bn == RTHBar + start + 40 then TestPro(RTHBar,  start + 40).poc else
if  bn == RTHBar + start + 41 then TestPro(RTHBar,  start + 41).poc else
if  bn == RTHBar + start + 42 then TestPro(RTHBar,  start + 42).poc else
if  bn == RTHBar + start + 43 then TestPro(RTHBar,  start + 43).poc else
if  bn == RTHBar + start + 44 then TestPro(RTHBar,  start + 44).poc else
if  bn == RTHBar + start + 45 then TestPro(RTHBar,  start + 45).poc else
if  bn == RTHBar + start + 46 then TestPro(RTHBar,  start + 46).poc else
if  bn == RTHBar + start + 47 then TestPro(RTHBar,  start + 47).poc else
if  bn == RTHBar + start + 48 then TestPro(RTHBar,  start + 48).poc else
if  bn == RTHBar + start + 49 then TestPro(RTHBar,  start + 49).poc else
if  bn == RTHBar + start + 50 then TestPro(RTHBar,  start + 50).poc else
if  bn == RTHBar + start + 51 then TestPro(RTHBar,  start + 51).poc else
if  bn == RTHBar + start + 52 then TestPro(RTHBar,  start + 52).poc else
if  bn == RTHBar + start + 53 then TestPro(RTHBar,  start + 53).poc else
if  bn == RTHBar + start + 54 then TestPro(RTHBar,  start + 54).poc else
if  bn == RTHBar + start + 55 then TestPro(RTHBar,  start + 55).poc else
if  bn == RTHBar + start + 56 then TestPro(RTHBar,  start + 56).poc else
if  bn == RTHBar + start + 57 then TestPro(RTHBar,  start + 57).poc else
if  bn == RTHBar + start + 58 then TestPro(RTHBar,  start + 58).poc else
if  bn == RTHBar + start + 59 then TestPro(RTHBar,  start + 59).poc else
if  bn == RTHBar + start + 60 then TestPro(RTHBar,  start + 60).poc else
if  bn == RTHBar + start + 61 then TestPro(RTHBar,  start + 61).poc else
if  bn == RTHBar + start + 62 then TestPro(RTHBar,  start + 62).poc else
if  bn == RTHBar + start + 63 then TestPro(RTHBar,  start + 63).poc else
if  bn == RTHBar + start + 64 then TestPro(RTHBar,  start + 64).poc else
if  bn == RTHBar + start + 65 then TestPro(RTHBar,  start + 65).poc else
if  bn == RTHBar + start + 66 then TestPro(RTHBar,  start + 66).poc else
if  bn == RTHBar + start + 67 then TestPro(RTHBar,  start + 67).poc else
if  bn == RTHBar + start + 68 then TestPro(RTHBar,  start + 68).poc else
if  bn == RTHBar + start + 69 then TestPro(RTHBar,  start + 69).poc else
if  bn == RTHBar + start + 70 then TestPro(RTHBar,  start + 70).poc else
if  bn == RTHBar + start + 71 then TestPro(RTHBar,  start + 71).poc else
if  bn == RTHBar + start + 72 then TestPro(RTHBar,  start + 72).poc else
if  bn == RTHBar + start + 73 then TestPro(RTHBar,  start + 73).poc else
if  bn == RTHBar + start + 74 then TestPro(RTHBar,  start + 74).poc else
if  bn == RTHBar + start + 75 then TestPro(RTHBar,  start + 75).poc else
if  bn == RTHBar + start + 76 then TestPro(RTHBar,  start + 76).poc else
if  bn == RTHBar + start + 77 then TestPro(RTHBar,  start + 77).poc else
if  bn == RTHBar + start + 78 then TestPro(RTHBar,  start + 78).poc else
if  bn == RTHBar + start + 79 then TestPro(RTHBar,  start + 79).poc else
if  bn == RTHBar + start + 80 then TestPro(RTHBar,  start + 80).poc else
if  bn == RTHBar + start + 81 then TestPro(RTHBar,  start + 81).poc else
if  bn == RTHBar + start + 82 then TestPro(RTHBar,  start + 82).poc else
if  bn == RTHBar + start + 83 then TestPro(RTHBar,  start + 83).poc else
if  bn == RTHBar + start + 84 then TestPro(RTHBar,  start + 84).poc else
if  bn == RTHBar + start + 85 then TestPro(RTHBar,  start + 85).poc else
if  bn == RTHBar + start + 86 then TestPro(RTHBar,  start + 86).poc else
if  bn == RTHBar + start + 87 then TestPro(RTHBar,  start + 87).poc else
if  bn == RTHBar + start + 88 then TestPro(RTHBar,  start + 88).poc else
if  bn == RTHBar + start + 89 then TestPro(RTHBar,  start + 89).poc else
if  bn == RTHBar + start + 90 then TestPro(RTHBar,  start + 90).poc else
if  bn == RTHBar + start + 91 then TestPro(RTHBar,  start + 91).poc else
if  bn == RTHBar + start + 92 then TestPro(RTHBar,  start + 92).poc else
if  bn == RTHBar + start + 93 then TestPro(RTHBar,  start + 93).poc else
if  bn == RTHBar + start + 94 then TestPro(RTHBar,  start + 94).poc else
if  bn == RTHBar + start + 95 then TestPro(RTHBar,  start + 95).poc else
if  bn == RTHBar + start + 96 then TestPro(RTHBar,  start + 96).poc else
if  bn == RTHBar + start + 97 then TestPro(RTHBar,  start + 97).poc else
if  bn == RTHBar + start + 98 then TestPro(RTHBar,  start + 98).poc else
na;

plot
LoVA = if   bn > HighestAll(RTHBar)
       then lva else na;
plot
HiVA = if   bn > HighestAll(RTHBar)
       then hva else na;
plot
PointOfControl = if   bn > HighestAll(RTHBar)
                 then poc else na;

LoVA.SetDefaultColor(Color.VIOLET);
LoVA.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
LoVA.EnableApproximation();
LoVA.SetLineWeight(2);
HiVA.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
HiVA.SetDefaultColor(Color.VIOLET);
HiVA.EnableApproximation();
HiVA.SetLineWeight(2);
PointOfControl.SetDefaultColor(Color.YELLOW);
PointOfControl.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
PointOfControl.EnableApproximation();
PointOfControl.SetLineWeight(2);

#AddCloud(close, PointOfControl, color1 = Color.GREEN, showBorder = yes);

#Cloud - Close Proximity to Pointofcontrol
input showcloud = no;
def rthrs = Between(GetTime(), RegularTradingStart(GetYYYYMMDD()),
                    RegularTradingEnd(GetYYYYMMDD()));
def crossbn     = if close crosses PointOfControl then bn else Double.NaN;
def touch       = Between(PointOfControl, low, high);
AddCloud(if showcloud and !touch and bn >= HighestAll(crossbn)
         then close
         else Double.NaN,
         PointOfControl,
         Color.GREEN, Color.RED);
                 
#
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
424 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top