关于wld的问题请教

Discussion in 'Wealth-Lab Developer' started by mydii, Feb 25, 2005.

  1. 我想问问WLD可不可以做画出未来的图,就是我自己编程画的图 可以延续到未来一些日子而不是价格图上最后一个bar就是图的终点了。就等于是图上有一段没有具体的价格bar
     
  2. AddFutureBars( Bars: integer );

    RChartScripts XSimuScripts XPerfScripts XCMScripts

    Description

    Adds the number of bars specified in the Bars parameter to the end of the chart. The added bars are considered "synthetic", and calling SyntheticBar with these bar numbers will return true. The OHLC values of the added bars are taken from the last actual bar in the chart. You can change the values of these (or any) bars by using the ChangeBar method.

    Note: AddFutureBars is not currently compatible with Real-time Scans or ChartScript windows.

    If AddCalendarDays had previously been called, the future bars will include non-trading days. If AddCalendarDays had not been called, the future bars will not include weekend days (Saturday, Sunday).

    Remarks



    ?Functions that make changes to the Primary Data Series, such as ChangeBar and AddFutureBars, should not be used in scripts opened for Optimization.



    ?AddFutureBars is not available for use on the web site, only in Wealth-Lab Developer 3.0.

    Warning! Adding futures bars will affect when Alerts are issued for an established trading system. Alerts are generated when a trading signal occurs after the last bar of the chart, i.e., on bar number BarCount. This means that if a system developer is using future bars, Alerts will also be projected into the future by the number of bars added.

    Example



    var Bar: integer;

    DrawLabel( 'BarCount Before: ' + IntToStr( BarCount ), 0 );

    if IsDaily then

    AddCalendarDays( false );

    AddFutureBars( 20 );

    DrawLabel( 'BarCount After: ' + IntToStr( BarCount ), 0 );

    for Bar := 0 to BarCount - 1 do

    if SyntheticBar( Bar ) then

    SetBarColor( Bar, #Red );
     
  3. 谢谢玲玲姐!