请教 在AB里, 能否在同一个 chart 里显示 2 个或以上的 symbol 吗 ?

Discussion in 'AmiBroker' started by cai, Jun 23, 2008.

  1. cai

    cai

    想请教在AB里, 能否在同一个 chart 里显示 2 个或以上的 symbol 吗 ? 如果可以的话, 应该怎样做, time 和 scale 会不会有显示问题 ? 比如一只价值 $50 和 一只价值 $ 5 的股票在同一个图表里显示那个 scale (y-axis) 会怎样 ?

    我查过 AB 的用户手册好像没有这个多 symbol 於一图表显示这功能, 所以前来求助.

    谢谢.
     
  2. Use the "Price(foreign)" indicator. Set the style of the indicator to "OwnStyle".
     
  3. cai

    cai

    Thank so much for your help. I write it in this format and seems work, but dont know how to set the chart style, eg CandleStick.

    SetForeign("MSFT");
    Plot( Ultimate(), "Ultimate from MSFT", colorRed );

    One more thing I would like to know is that does amibroker allow to import data in price-time format, instead of O-H-L-C ? For example, I want to compare Stock A with the oil price, however, the oil price is in a price-time format (price with y-axis and time for x-axis), so can I import just 2 columns in order to create a database, say oil symbol ?

    If that can be done, how can I then plot the oil symbol into the Stock A chart ? With the Foreign () function, how can I do this, only O-H-L-C ?

    C = Foreign( "oil", "C" );
    O = Foreign( "oil", "O" );
    H = Foreign("oil", "H" );
    L = Foreign( "oil", "L" );
    SetForeign("oil");
    Plot( Ultimate(), "Ultimate from oil", colorRed );
     
  4. try this:
    SetForeign("MSFT");
    Plot( Ultimate(), "Ultimate from MSFT", colorRed, styleCandle );


    For the oil Q, I'm not sure if I understand you. If you only have the closing price for oil then how could you "foreign" its O, H, L price?
     
  5. cai

    cai

    Can you kindly let me know the syntax of the function Price (foreign) since I cant find this function in the user manual. Is it something to do with the formula edit ? Here is a typical formula for any symbol :

    _SECTION_BEGIN("Price");
    SetChartOptions(0,chartShowArrows|chartShowDates);
    _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
    Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
    _SECTION_END();

    How can I put the Price(foreign) into the formula so another symbol (Stock B)can be added in the current chart (Stock A) ? Thanks a lot.

    For the Oil price example, if the data I got is just 2 columns (date, close, no open, high, low), that it will come out as a LINE. Will it be acceptable for amibroker to create any symbol database with just closing price and the date ? Just like I have a ASCII text file in which it only contains the closing price and the date.