Candlestick Plot

If you have 4 waves containing the opening price, closing price, high price and low price, each with the same number of points, you can generate a candlestick plot along the lines of http://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:i… using this function.

Function Candlestick(Opens,Closes,Highs,Lows,Times)
    Wave Opens,Closes,Highs,Lows,Times
    Display Highs,Lows,Opens,Closes vs Times
        String highz=NameOfWave(Highs), lowz=NameOfWave(lows), openz=NameOfWave(Opens), closez=NameOfWave(Closes)
    ModifyGraph mode($Highz)=1,mode($Lowz)=6,mode($Openz)=5,mode($Closez)=5
    ModifyGraph lSize($Lowz)=0,lSize($Openz)=1,lSize($Closez)=0
    ModifyGraph rgb($Highz)=(0,0,0),rgb($Lowz)=(0,0,0),rgb($Openz)=(65535,65355,65335),rgb($Closez)=(0,0,0)
    ModifyGraph hbFill($Openz)=2,hbFill($Closez)=1
    ModifyGraph toMode($Highz)=1,toMode($Openz)=1
    ModifyGraph useBarStrokeRGB($Openz)=1,useBarStrokeRGB($Closez)=1
    ModifyGraph offset($Openz)={-0.5,0},offset($Closez)={-0.5,0}
    Make /o/n=(dimsize(Opens,0),3) Fills=65535*(Closes[p]>Opens[p])
    ModifyGraph zColor($Openz)={Fills,*,*,directRGB}
End

Forum

Support

Gallery

Igor Pro 8

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More