Discrepancy in open high low close value for straddle chart in pine script - Stack Overflow

Below is the code i am using for genearte candle stick chart for straddle options for nifty. But when i

Below is the code i am using for genearte candle stick chart for straddle options for nifty. But when i plot same chart on tradingview the high low values are different than they should be. Can someone please help me resolve the issue to get correct values? I tried using barmerge.gaps and lookahead but it did not make any difference. Any help is appreciated.

//@version=5
indicator('Straddle', shorttitle='Options_Straddle', timeframe='', overlay = false)
OptionsChart1 = input.symbol('', title='OptionsChart1 Symbol')
OptionsChart2 = input.symbol('', title='OptionsChart2 Symbol')
_developingLineStyle = 'Combined'

var o = 0.00
var h = 0.00
var l = 0.00
var c = 0.00

[oo, hh, ll, cc] = request.security(OptionsChart1, timeframe.period, [open, high, low, close], barmerge.gaps_on)
[ooo , hhh, lll , ccc]= request.security(OptionsChart2, timeframe.period, [open, high, low, close], barmerge.gaps_on)

if _developingLineStyle == 'Combined'

    o := oo + ooo
    h := hh + hhh
    l := ll + lll
    c := cc + ccc

// if _developingLineStyle == 'Difference'

//     o := oo - ooo
//     h := hh - hhh
//     l := ll - lll
//     c := cc - ccc

// if _developingLineStyle == 'Ratio'
//     o := oo / ooo
//     h := hh / hhh
//     l := ll / lll
//     c := cc / ccc


ourWickColor = c > c[1] ? color.green : color.red
plotcandle(o, h , l, c, title='OptionsStraddle', color=ourWickColor, force_overlay = false)**strong text**

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745632415a4637187.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信