HLC BARS NOT OHLC

MAGICO

New member
How can I use HLC bars in TOS like the pictures. Someone can help me with this. Thanks.

AmebsXv.jpg
 

rad14733

Well-known member
VIP
@MAGICO I have no idea why you aren't satisfied with what Thinkorswim has to offer but if you aren't then it surely isn't our job to point you to a platform that better suits you... Go do your own research, plain and simple...!!! Or learn to live within Thinkorswims limitations... These forums are for traders who use and enjoy Thinkorswim... I'll go so far as to say that I'm appalled when members come here asking us to convert Thinkscripts to other platforms, and I'm not to keen on repetitive requests to convert scripts from other platforms to Thinkscript... This is a coding forum, to learn to use and write Thinkscript, not place for members to beg for others to do their work for them... I hope I've made myself clear...
 

mashume

Well-known member
VIP
Per @SleepyZ, who fancied-up my suggestion there to use AddChart in another thread (https://usethinkscript.com/threads/change-opacity-of-cloud.5721/post-54287), you can use the AddChart (though it is deprecated and wonky as all get out)
Code:
#addchart - up/down heiken ashi candle colors - workaround for the addchart() function not supported by TOS

def nan = double.nan;
def o = open;
def c = close;
def h = high;
def l = low;

AddChart(high = if c > o then h else nan,
         low = if c > o then l else nan,
         close = if c > o then c else nan,
         open = if c > o then nan else nan,
         ChartType.BAR, Color.dark_GREEN);
AddChart(high = if c < o then h else nan,
         low = if c < o then l else nan,
         open = if c < o then nan else nan,
         close = if c < o then c else nan,
         ChartType.BAR, Color.dark_RED);
AddChart(high = if c == o then h else nan,
         low = if c == o then l else nan,
         open = if c == o then nan else nan,
         close = if c == o then c else nan,
         ChartType.BAR, Color.GRAY);

See how the open is always a double.nan? That's how you can ignore the open price.

happy trading,
mashume


P.S. If you don't want to use the (c<o|c>o|c==o) set of operations -- if you want to ignore open prices entirely, you can replace the o in each of them with c[1] (c<c[1]|c>c[1]|c==c[1]).
 
Last edited:

MAGICO

New member
@MAGICO I have no idea why you aren't satisfied with what Thinkorswim has to offer but if you aren't then it surely isn't our job to point you to a platform that better suits you... Go do your own research, plain and simple...!!! Or learn to live within Thinkorswims limitations... These forums are for traders who use and enjoy Thinkorswim... I'll go so far as to say that I'm appalled when members come here asking us to convert Thinkscripts to other platforms, and I'm not to keen on repetitive requests to convert scripts from other platforms to Thinkscript... This is a coding forum, to learn to use and write Thinkscript, not place for members to beg for others to do their work for them... I hope I've made myself clear...
thanks for your reply
Per @SleepyZ, who fancied-up my suggestion there to use AddChart in another thread (https://usethinkscript.com/threads/change-opacity-of-cloud.5721/post-54287), you can use the AddChart (though it is deprecated and wonky as all get out)
Code:
#addchart - up/down heiken ashi candle colors - workaround for the addchart() function not supported by TOS

def nan = double.nan;
def o = open;
def c = close;
def h = high;
def l = low;

AddChart(high = if c > o then h else nan,
         low = if c > o then l else nan,
         close = if c > o then c else nan,
         open = if c > o then nan else nan,
         ChartType.BAR, Color.dark_GREEN);
AddChart(high = if c < o then h else nan,
         low = if c < o then l else nan,
         open = if c < o then nan else nan,
         close = if c < o then c else nan,
         ChartType.BAR, Color.dark_RED);
AddChart(high = if c == o then h else nan,
         low = if c == o then l else nan,
         open = if c == o then nan else nan,
         close = if c == o then c else nan,
         ChartType.BAR, Color.GRAY);

See how the open is always a double.nan? That's how you can ignore the open price.

happy trading,
mashume


P.S. If you don't want to use the (c<o|c>o|c==o) set of operations -- if you want to ignore open prices entirely, you can replace the o in each of them with c[1] (c<c[1]|c>c[1]|c==c[1]).
how can i make the bar much thicker?
 

Similar threads

Top