Plot lines extended from swing high and low pivots


Category:
0
0

So with the code presented:

Def swinghigh = if high > high[1] and high > high[2] and high > high[-1] and high > high[-2] then 1 else 0;

Plot sh = if swinghigh then high else double.nan;

sh.setstyle(curve.points);

With that being said; I am trying to have additional lines for plotting after the swing points; as seen in the image below; but having a tough time figuring the remainder of the code..

Attachments:
Marked as spam
Posted by (Questions: 3, Answers: 1)
Asked on September 3, 2020 9:00 am
155 views
0
Private answer

I was really struggling to understand what you are requesting from the title of the question you entered. So I updated the title of the question to fully explain what I believe you are requesting. I am relying on the screenshot to understand the request.

It seems that you are trying to reverse engineer someone else's code here. If that code is someone else's proprietary chart study this is strictly against our Terms and Conditions:

https://www.hahn-tech.com/terms-and-conditions/

Having explained that, you have provided your own section of code that gets us most of the way and there is only the slightest hint that you are trying to reverse engineer someone else's proprietary chart study. I'll give you the benefit of the doubt and provide a solution. However please be careful to read our terms and conditions and understand what is expected for posts in this forum.

The following code takes your swing high variable and plots a price level on the chart which extended from the high of each pattern to the right until the next pattern appears.

def swingHigh = high > high[1] and high > high[2] and high > high[-1] and high > high[-2];
rec trackSwingHigh = if swingHigh[2] then high[2] else trackSwingHigh[1];
plot swingHighLevels = trackSwingHigh[-2];
swingHighLevels.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on September 3, 2020 9:34 am
0
Thank you for your time..
( at September 3, 2020 1:56 pm)