Plotting with styleBar

Using Windows 10, 64 bit, AB 6.35.1

I tried to plot same price array as a line and bar graph. Two issues:

  1. The resulting plots look very different though values from both plots are the same.
  2. Bar graph is green even though it is supposed to be black
    image

Code below

Index					= Foreign("$SPX","C");
//
Plot(Index,"",colorBlack,styleThick);
Plot(Index,"",colorBlack,styleThick|styleBar|styleownscale);

Simple.

You retrieve only CLOSE price via Foreign in your code!

Plot() and styleBar will plot Open, High, Low and Close data bars but you have not retrieved O, H, L from Foreign symbol. So Open, High and Low are from selected symbol ("BA").

Solution:
Use PlotForeign() function

PlotForeign("$SPX", "S&P500", colorBlack, styleBar);
1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.