Heikin-Ashi Real Price Line with natural open close


Category:
0
1

Hello Mr.Pete

First of all, thank you so much for incredible work that you do for us its greatly appreciated.

I came across with this studies that shows the actual open and high within the Heikin-Ashi candles with colored dots, white dot for the “open” and red dot for the “close” and also have a real price line that moves along  with the price movement. Unfortunately  this is from “TradingView platform” free open source script that’s not compatible with thinksrips . Is it possible to convert or rewrite this code to make it work on Thinkorswim? I also like to make small adjusments instead of dots I like to use a lines that are similar to dashes (I will attach example picture) and have the option to change the colors of plots and line from the studies menu. I will put code and the link for reference .

https://www.tradingview.com/script/iCq7We0z-Real-Price-Line-Dots-for-Heikin-Ashi/

Thank you,

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on December 12, 2023 2:11 pm
65 views
0
Private answer

We can do this on Thinkorswim using two standard simple moving averages and two lines of custom script. The screenshot below shows how to add two simple moving averages to the chart. Then you set the length of each average to a value of 1 and set one to the close and the other to the open. Then you can style the plots however you like. In my example I set the close to dots and the open to dashes. (to make it easier to tell them apart).

And for the "Real Price Line". We do that will two lines of code added to a new custom chart study:

def lastBar = IsNaN(close[-1]) and !IsNaN(close);
plot naturalClose = HighestAll(if lastBar then close else Double.NaN);

 

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on December 12, 2023 4:06 pm
0
Hello Mr Pete, I apologize for posting my follow up question to the Solution Section. Still learning the forum. Thank you for clarifying the solution. After selecting the correct plot style I got it to working, but now the issue I'm facing is little hard to read the price action because there is a lot of dashes everywhere, is it possible to limit to plot only last 2 or 3 candles? I came up with this > input limit_plot_to_x_bars = 3; But not sure where to plug it in since there's no script for this study. Thank you so much
( at December 23, 2023 5:44 pm)
0
That would require an entirely new solution. The solution above is based on using standard simple moving averages. There is no way to modify those to limit which bars are plotted. I suggest you try setting the transparency through the color settings to make the dashes less conspicuous. Or adjust the colors themselves so that they do not obscure the price action so much.
( at December 23, 2023 6:47 pm)