最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin7PV0评论

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**
Post a comment

comment list (0)

  1. No comments so far