[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] AmiBroker 4.42.0 BETA released



PureBytes Links

Trading Reference Links




Hello,
 
Since traffic is high I have put the file also on 
amibroker.net server:
<A 
href=""><FONT 
size=2>http://www.amibroker.net/members/bin/ab4420beta.exe
 
(user/password the same as in amibroker.com site)
 

If you forgot your user name / password to the members 
area
you can use automatic reminder service at: <A 
href=""><FONT 
size=2>http://www.amibroker.com/login.html
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Tomasz Janeczko 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, September 25, 2003 8:51 
  PM
  Subject: [amibroker] AmiBroker 4.42.0 
  BETA released
  
  Hello,
   
  
  A new beta version (4.42.0) of AmiBroker has just been 
  released.
   
  It is available for registered users only from the members 
  area at:
  <FONT 
  size=2>http://www.amibroker.com/members/bin/ab4420beta.exe
   
  If you forgot your user name / password to the members 
  area
  you can use automatic reminder service at: <A 
  href=""><FONT 
  size=2>http://www.amibroker.com/login.html
   
  
  
  
  
  
  CHANGES FOR VERSION 4.42.0 (as compared to 
  4.41.2)
  
    
    
    
    
    first (incomplete) early beta version of the portfolio backtester 
    (see documentation 
    below)
    fixed plot of Null arrays using styleArea 
    fixed display problem with % progress in single-stock optimization 
    other minor fixes
  Best regards,Tomasz 
  Janeczkoamibroker.com
   
  
  AmiBroker 4.42.0 Beta Read Me
  September 25, 2003 20:36 
  
  THIS IS A BETA VERSION OF THE SOFTWARE. EXPECT BUGS !!!
  Backup your data files and entire AmiBroker folder 
  first!
  INSTALLATION INSTRUCTIONS
  IMPORTANT: This archive is update-only. You have to install full 
  version 4.40 first. 
  Just run the installer and follow the instructions. 
  Then run AmiBroker. You should see "AmiBroker 4.42.0 beta" written in the 
  About box.
  See CHANGE LOG below for detailed list of changes.
  HELP ON NEW FEATURES
  New portfolio backtester
  IMPORTANT: Since the new backtester is not yet 
  complete and I am still working on it please accept that until it is 
  finished I will essentially provide no technical support for it. The only 
  exceptions are bugs you may find. If you think that there is a bug please 
  report it to bugs@xxxxxxxxxxxxx with 
  all details you can give including: the formula, HTML report generated by 
  AmiBroker, trade list or detailed log, etc. 
  From version 4.42.0 BETA through some future betas there will be TWO 
  backtesters. The OLD one that is triggered by pressing "Backtest" or 
  "Optimize" button in the Automatic Analysis window. And NEW one, 
  portfolio-level backtester that is triggered by pressing "Portfolio Test" 
  button in Automatic Analysis window. 
  Old backtester is untouched and it works exactly the same way as in 
  pre-4.42 versions. I have decided to leave it for a while so you can 
  continue using old your own formulas, results, etc while checking out new 
  backtester. 
  New backtester is NOT COMPLETE yet, but already provides substantial amount 
  of functionality to make it worthwhile to check it out.
  New backtester works in TWO modes:
  
    Regular mode: evaluates ordinary buy/sell/short/cover signals as the old 
    backester but on the PORTFOLIO level 
    Ranking/scoring mode: uses user-defined score to rank securities and 
    enter trades in highest scored securities. Buy/sell/short/cover signals are 
    IGNORED in that mode. 
  Ranking/scoring functionality has been partially inspired by Fred Tonetti's 
  PortfolioTrader (PT), however it is different in some details (see below). The 
  software implementation is on the other hand completely different to make the 
  portfolio testing part as fast as other parts of AmiBroker. Since PT already 
  got some attention I thought that it will be good thing for the users to make 
  porting from PT as easy as possible. Thank-yous go to Fred and Dale for their 
  work on PT.
  Regular mode
  This mode is default one. Everything works as in old backtester with the 
  exception that test is performed on portfolio. IMPORTANT: to 
  enable more than one symbol to be traded you have to add PositionSize variable 
  to your formula, so less than 100% of funds are invested in single 
  security:
  PositionSize = -25; // invest 25% of portfolio equity in single 
security
  or
  PositionSize = 5000; // invest $5000 into single security
  Ranking/Scoring mode
  This mode uses user-defined score to rank securities and enter trades in 
  highest scored securities. Buy/sell/short/cover signals are IGNORED in that 
  mode.
  To enter this mode you have to include PositionScore variable in your 
  formula. Once you include PostionScore variable, buy/sell/short/cover 
  variables will have NO EFFECT on results.
  A simple ranking / scoring formula (actually Fred's PT 'Sample' formula 
  ported to new backtester):
  SOV1=21;
  BBandWid = 2;BBAvg = MA(Close, SOV1);UBBand = BBandTop(Close, 
  SOV1, BBandWid);LBBand = BBandBot(Close, SOV1, BBandWid);rScore = 50 - 
  100 * (Close - LBBand) / (UBBand - LBBand);
  PositionSize = -25; // invest 25% of equity in single 
  securityPositionScore = rScore; // PositionScore has the same meaning as 
  rScore in PT
  Exactly as in PT all securities will be scored, based on a separate user 
  supplied PositionScore variable but only the top candidates as defined by the 
  value of MaxRanked will be kept as securities to be potentially traded. The 
  results of scoring are evaluated and ranked as follows:
  The higher the positive number the better the long candidate.
  The lower the negative number the better the short candidate.
  Zero is treated as having disqualified a particular security for a 
  particular bar.
  In terms of choosing between long and short candidates the absolute 
  value of the score will determine which is to be the higher 
  ranking score. 
  Things NOT IMPLEMENTED yet in new portfolio backtester, to be done 
  soon
  
    built-in stops in scoring/ranking mode. (stops in regular mode work 
    already) 
    futures support (point value, margin deposit, ticksize) 
    calculation of interest earnings 
    pyramiding 
    intra-bar detailed timing 
    OLE interface 
    more statistics (RRR, Sharpe ratio, Ulcer index, etc...) 
    optimization 
    etc... 
  Automatic Analysis Settings - Portfolio page
  - Max. traded - the maximum number of simultaneously open positions. 
  Suggestions for better name welcome.
  - Max. ranked - (SCORING/RANKING mode only!!!) the maximum number of 
  securities that will be ranked. When MaxRanked is greater than MaxTraded once 
  a position is taken in a security it will not be exited until the ranking of 
  that security drops below MaxRanked. Suggestions for better name welcome. This 
  name is good for PT users since they already know it but personally I have 
  mixed feelings about this name
  - Max. tracked - (REGULAR mode only) the maximum number of 
  buy/sell/short/cover signals per single bar that AmiBroker will track. Should 
  be set to at least 2 * (Max. Traded) or more. Default of 100 should be fine 
  for most applications. May be removed in the future.
  - Report mode - Trade list - shows regular trade list (as old backtester), 
  Detailed log - shows very detailed bar-by-bar log with rankings, each entry 
  and exit separately reported, etc.
  - Min. shares - the minimum number of shares that are allowed to buy/short. 
  Backtester will not enter trades below that limit. Default = 1 is good for 
  stocks.
  Known differencies between statistics produced by 'old' and 'new' 
  (portfolio) backtester
  
    
    
       
      Old backtester
      New (portfolio) backtester
    
      System and trade drawdown calculations based on
      Open/Close/H-L range (worst case) selectable in settings
      Close price only (regardless of settings) - subject to change
    
      Max. % trade drawdown
      Calculated based on total equity
      Calculated based on ACTUAL trade value at entry point.
    
      Stats available 
      for all trades only
      separately for long, short and all trades
    
      Futures backtesting (MarginDeposit, TickSize, PointValue)
      Supported
      Not yet available
    
      Interest earnings calculation
      Supported
      Not yet available
    
      PositionSizing
      Based on individual symbol equity 
      
        Based on portfolio equity.
        PositionSize = -25; 
        will enter 25% of current porfolio equity
    
      Trade statistics
      Include only closed trades, open trade is reported separately
      Include all trades (closed and those still open at the end of 
        analysis period)
    
      Positions taken
      Uses "Positions" selector in the Settings to include long, short or 
        both positions
      Currently always works in both long and short mode but does not 
        complain about missing variables. So for long only system just use only 
        buy/sell variables, and for short only system use only short/cover 
        variables. May be changed in the future.
    
      Multiple security testing
      N independent accounts (multiple single equity)
      Portfolio equity common to all symbols under 
test
  Known differencies between Fred's PT and new portfolio backtester working 
  in ranking mode
  
    
    
       
      PT
      New (portfolio) backtester
    
      PositionSizing
      Common to all symbols, settable via PT GUI
      
        Settable individually from the formula level using PositionSize 
        variable. Examples:PositionSize =2000; // will enter positions 
        with equal size of 2000 and will grow the NUMBER of positions as equity 
        grows (similar to PT setting: Increase Position first)
        PositionSize = -25; // will enter positions with 25% of current 
        portfolio equity (similar to PT setting: increase position size 
        first)
        
    
      Calculation of initial position value
      
        PT subtracts NTraded * commission from the equity and by number of 
        symbols to calculate new position value.
        Example: Equity is 1000. MaxTraded is 4, Commission per trade is 
1
        PT will enter 4 positions with value of (1000- 4 * 1)/4 = 249
      
        AB enters the position with the value specified by positionsize 
        variable if there are enough funds and adds commission on top of it, 
        otherwise shinks desired position.Example: Equity is 1000. 
        PositionSize = -25 (25% of equity available), Commission per trade is 
        1.
        AmiBroker will enter 4 positions:
        1. 1000 * 25% = 250. Commission $1. Available cash = 749. 2. 1000 
        * 25% = 250. Commission $1. Available cash = 548.3. 1000 * 25% = 
        250. Commission $1. Available cash = 2474. 1000 * 25% = 250 -> 
        not enough cash -> shrinking position to $246. Commission $1. 
        Available cash = 0.
         
    
      Trade price
      Open or Close
      
        Entry price is controllable via
        BuyPrice and ShortPrice variables (or AA settings)
        in ranking mode exits are currently done on Close always. This will 
        be changed.
    
      Exits by Stops, Trade delays
      Available
      Not yet available
    
      Trade listing
      Sorted by entry date
      Sorted by EXIT date. Can be re-sorted by any other column available 
        in report by clicking on column header.
   
   
  Multiple time frame support
  Release 4.41 brings ability to use multiple time frames (bar intervals) in 
  single formula. The time frame functions can be divided into 3 functional 
  groups: 
  
    switching time frame of build-in O, H, L, C, V, OI, Avg arrays: 
    TimeFrameSet, TimeFrameRestore 
    compressing/expanding single arrays to/from specified interval: 
    TimeFrameCompress, TimeFrameExpand 
    immediate access to price/volume arrays in different time frame: 
    TimeFrameGetPrice 
  First group is used when your formula needs to perform 
  some calculations on indicators in different time frame than currently 
  selected one. For example if you need to calculate 13-bar moving average on 5 
  minute data and 9 bar exponential avarage from hourly data while current 
  interval is 1 minute you would write:
  TimeFrameSet( in5Minute ); // switch to 5 minute 
  frame
  /* MA now operates on 5 minute data, ma5_13 holds time-compressed 13 
  bar MA of 5min bars */
  ma5_13 = MA( C, 13 ); 
  TimeFrameSet( inHourly ); // switch now 
  to hourly
  mah_9 = EMA( C, 9 ); // 9 bar moving average from hourly 
  data
  TimeFrameRestore(); // restore time frame to 
  original
  Plot( Close, "Price", colorWhite, styleCandle );
  // plot expanded average
  Plot( TimeFrameExpand( ma5_13, in5Minute), "13 bar 
  moving average from 5 min bars", colorRed );Plot( 
  TimeFrameExpand( mah_9, inHourly), "9 bar moving average from 
  hourly bars", colorRed );
  TimeFrameSet( interval ) - replaces 
  current built-in price/volume arrays: open, high, low, close, volume, openint, 
  avg with time-compressed bars of specified interval once you switched to a 
  different time frame all calculations and built-in indicators operate on 
  selected time frame. To get back to original interval call TimeFrameRestore() 
  funciton. Interval is time frame interval in seconds. For example: 60 is one 
  minute bar. You should use convenient constants for common intervals: 
  in1Minute, in5Minute, in15Minute, inHourly, inDaily, inWeekly, inMonthly.
  TimeFrameRestore() - restores price arrays replaced by 
  SetTimeFrame.Note that only OHLC, V, OI and Avg built-in variables are 
  restored to original time frame when you call TimeFrameRestore().All other 
  variables created when being in different time frame remain compressed. To 
  de-compress them to original interval you have to use TimeFrameExpand.
  Once you switch the time frame using TimeFrameSet, all AFL functions 
  operate on this time frame until you switch back the time frame to original 
  interval using TimeFrameRestore or set to different interval again using 
  TimeFrameSet. It is good idea to ALWAYS call TimeFrameRestore when you are 
  done with processing in other time frames.
  When time frame is switched to other than original interval the results of 
  all functions called since TimeFrameSet are time-compressed too. If you want 
  to display them in original time frame you would need to 'expand' them as 
  described later. Variables created and assigned before call to TimeFrameSet() 
  remain in the time frame they were created. This behaviour allows mixing 
  unlimited different time frames in single formula.
  Please note that you can only compress data from shorter interval to longer 
  interval. So when working with 1-minute data you can compress to 2, 3, 4, 5, 
  6, ....N-minute data. But when working with 15 minute data you can not get 
  1-minute data bars. In a similar way if you have only EOD data you can not 
  access intraday time frames.
  Second group: TimeFrameCompress/TimeFrameExpand allow to 
  compress and expand single arrays to / from different time frames. Especially 
  worth mentioning is TimeFrameExpand that is used to decompress array variables 
  that were created in different time frame. Decompressing is required to 
  properly display the array created in different time frame. For example if you 
  want to display weekly moving average it must be 'expanded' so the data of one 
  weekly bar covers five daily bars (Monday-Friday) of corresponding week.
  
  
  TimeFrameExpand( array, interval, mode = expandLast ) - 
  expands time-compressed array from 'interval' time frame to base time frame 
  ('interval' must match the value used in TimeFrameCompress or 
  TimeFrameSet)Available modes:expandLast - the compressed value is 
  expanded starting from last bar within given period (so for example weekly 
  close/high/low is available on Friday's bar)expandFirst - the compressed 
  value is expanded starting from first bar within given period (so for example 
  weekly open is available from Monday's bar)expandPoint - the resulting 
  array gets not empty values only for the last bar within given period (all 
  remaining bars are Null (empty)).
  
  Caveat: expandFirst used on price different than open may look into the 
  future. For example if you create weekly HIGH series, expanding it to daily 
  interval using expandFirst will enable you to know on MONDAY what was the high 
  for entire week.
  TimeFrameCompress is provided for completeness and it can be used when you 
  want to compress single array without affecting built-in OHLC,V arrays. If you 
  call TimeFrameCompress it does not affect results of other functions.
  wc = TimeFrameCompress( Close, inWeekly );
  /* now the time frame is still unchanged (say daily) and our MA will 
  operate on daily data */
  dailyma = MA( C, 14 );
  /* but if we call MA on compressed array, it will give MA from other 
  time frame */
  weeklyma = MA( wc, 14 ); // note that argument is time-compressed 
  array
  Plot( dailyma, "DailyMA", colorRed );
  weeklyma = TimeFrameExpand( weeklyma, inWeekly ); // expand for 
  display
  Plot( weeklyma, "WeeklyMA", colorBlue );
  During this formula the time frame remained at original setting we only 
  compressed single array.
  TimeFrameCompress( array, interval, mode = compressLast 
  )- compresses single array to given interval using given compression mode 
  available modes:compressLast - last (close) value of the array within 
  intervalcompressOpen - open value of the array within 
  intervalcompressHigh - highest value of the array within 
  intervalcompressLow - lowest value of the array within 
  intervalcompressVolume - sum of values of the array within 
  interval
  graph0 = TimeFrameExpand( TimeFrameCompress( Close, inWeekly, 
  compressLast ), inWeekly, expandLast );graph1 = TimeFrameExpand( 
  TimeFrameCompress( Open, inWeekly, compressOpen ), inWeekly, expandFirst 
  );
  
  Third group consist of just one useful function: 
  TimeFrameGetPrice which allows to reference price and volume from other time 
  frames without switching /compressing/expanding time frames. Just one function 
  call to retrieve price from higher time frame. It allows also to reference not 
  only current but past bars from different time frames.
  TimeFrameGetPrice( pricefield, interval, shift = 0, mode = 
  expandFirst );- references OHLCV fields from other time frames. This works 
  immediatelly without need to call TimeFrameSet at all.Price field is one 
  of the following: "O", "H", "L", "C", "V", "I" (open interest). Interval is 
  bar interval in seconds. shift allows to reference past (negative values) and 
  future (positive values) data in higher time frame. For example -1 gives 
  previous bar's data (like in Ref function but this works in higher time 
  frame).
  Examples:
  TimeFrameGetPrice( "O", inWeekly, -1 ) - gives you previous 
  week OPEN priceTimeFrameGetPrice( "C", inWeekly, -3 ) - gives 
  you weekly Close price 3 weeks agoTimeFrameGetPrice( "H", inWeekly, 
  -2 ) - gives you weekly High price 2 weeks 
  agoTimeFrameGetPrice( "O", inWeekly, 0 ) - gives you this 
  week open price.
  TimeFrameGetPrice( "H", inDaily, -1 ) - gives previous day 
  high when working on intraday data
  
  Shift works as in Ref() function but it is applied to compressed time 
  frame.
  
  Note these functions work like these 3 nested 
  functionsTimeFrameExpand( Ref( TimeFrameCompress( array, interval, 
  compress(depending on field used) ), shift ), interval, expandFirst 
  )therefore if shift = 0 compressed data may look into the future ( 
  weekly high can be known on monday ). If you want to write a trading system 
  using this function please make sure to reference PAST data by using negative 
  shift value.The only difference is that TimeFrameGetPrice is 2x faster 
  than nested Expand/Compress.
  
    Note on performance of TimeFrame functions:a) 
    Measurements done on Athlon 1.46GHz, 18500 daily bars compressed to weekly 
    time frameTimeFrameGetPrice( "C", inWeekly, 0 ) - 0.0098 sec (9.8 
    milliseconds)TimeFrameSet( inWeekly ) - 0.012 sec (12 
    milliseconds)TimeFrameRestore( ) - 0.006 sec (6 
    milliseconds)TimeFrameCompress( Close, inWeekly, compressLast ); - 
    0.0097 sec (9.7 milliseconds)TimeFrameExpand( array, inWeekly, 
    expandLast ); - 0.0098 sec (9.8 milliseconds)
    
    b) Measurements done on Athlon 1.46GHz, 1000 daily bars compressed to 
    weekly time frameall functions below 0.0007 sec (0.7 
  millisecond)
  
  EXAMPLES
  EXAMPLE 1: Plotting weekly MACD and cross arrows from daily data 
  TimeFrameSet( inWeekly );m = MACD(12, 26 ); // MACD from WEEKLY 
  dataTimeFrameRestore();
  m1 = TimeFrameExpand( m, inWeekly );
  Plot( m1, "Weekly MACD", colorRed );PlotShapes( Cross( m1, 0 ) 
  * shapeUpArrow, colorGreen );PlotShapes( Cross( 0, m1 ) * shapeDownArrow, 
  colorGreen );
  EXAMPLE 2: weekly candlestick chart overlaid on line daily price 
  chart
  wo = TimeFrameGetPrice( "O", inWeekly, 0, expandPoint );wh 
  = TimeFrameGetPrice( "H", inWeekly, 0, expandPoint );wl = 
  TimeFrameGetPrice( "L", inWeekly, 0, expandPoint );wc = TimeFrameGetPrice( 
  "C", inWeekly, 0, expandPoint );
  PlotOHLC( wo, wh, wl, wc, "Weekly Close", colorWhite, styleCandle 
  );Plot( Close, "Daily Close", colorBlue ); 
  
  EXAMPLE 3: Simplified Triple screen system 
  /* switch to weekly time frame */TimeFrameSet( inWeekly 
  );whist = MACD( 12, 26 ) - Signal( 12, 26, 9 );wtrend = ROC( whist, 1 
  ); // weekly trend - one week change of weekly macd 
  histogramTimeFrameRestore();
  /* expand calculated MACD to daily so we can use it with daily 
  signals */wtrend = TimeFrameExpand( wtrend, inWeekly );
  /* elder ray */bullpower= High - 
  ema(Close,13);bearpower= Low - ema(Close,13);
  Buy = wtrend > 0 /* 1st screen: positive weekly trend 
  */ANDbearpower < 0 and bearpower > Ref( bearpower, -1 ) /* 2nd 
  screen bear power negative but rising */ANDH > Ref( H, -1 ); /* 3rd 
  screen, if prices make a new high */
  BuyPrice = Ref( H, -1 ); // buy stop level;
  
  Sell = 0 ; // exit only by stopsApplyStop( stopTypeProfit, 
  stopModePercent, 30, True );ApplyStop( stopTypeTrailing, stopModePercent, 
  20, True );
  CHANGE LOG
  
  
  
  
  CHANGES FOR VERSION 4.42.0 (as compared to 
  4.41.2)
  
    
    
    
    
    first (incomplete) early beta version of the portfolio 
    backtester
    fixed plot of Null arrays using styleArea 
    fixed display problem with % progress in single-stock optimization 
    other minor fixes
  
  
  
  
  CHANGES FOR VERSION 4.41.2 (as compared to 4.41.1)
  
    
    now Sum produces values for periods upto and including BarCount, so 
    Sum( array, BarCount ) gives the value instead of Null 
    
    fixed problem with saving parameters on exit when the user did not 
    specify default value for string parameter using ParamStr("name", "")
    
    fixed 38-byte memory leak when returning values from user-defined 
    functions
    
    real-time mode: after AFL syntax error commentary AFL editor is not 
    refreshed until error is fixed and user presses 'apply'
    
    eSignal 1.6.0 plugin (available separately from<A 
    href=""> 
    http://www.amibroker.com/bin/eSignal160.exe):
    
      
      much quicker backfills
      
      implemented force-reconnect feature in eSignal plugin
      
      fixed minor timing issue in eSignal plugin 
      implemented workaround to invalid tick numbers sent sometimes by 
      eSignal's data manager. 
  
    
    
    thanks to all users for reporting errors and helping ironing out 
    outstanding issues.
  
  CHANGES FOR VERSION 4.41.1 (as compared to 4.41.0)
  
    
    fixed chart refresh locking that happened when user was drawing some 
    object and abandonend it by pressing ESC key.
    
    View->Refresh and View->Refresh All menus now reset internal 
    chart refresh lock flag just in case.
    
    plugin status is refreshed more often
    
    maximum number of chart sheets increased to 60 (Caveat: when you 
    increase the number of sheets you would not be able to use the layouts with 
    OLDER versions of the software)
    
    TimeFrameSet() now affects result of Interval() AFL function. 
    TimeFrameRestore() resets it back.
    
    Plot() makes copies of OHL arrays when styleCandle or styleBar is used 
    so statements likeSetForeign("AAPL");Plot( C, "Price", 
    colorYellow, styleCandle );SetForeign("MSFT");Plot( C, "Price 2", 
    colorBlue, styleCandle );plot correctly. Previously one would 
    need to use PlotOHLC() or PlotForeign()
    
    separate heap for syntax tree walker implemented, so larger AFL 
    programs like PortfolioTrader should execute faster while retaining the 
    speed improvement gained in 4.40.4 for small formulas.
  
  
  CHANGES FOR VERSION 4.41.0 (as compared to 4.40.4)
  
    
    legacy 'stoch()' function removed. Use StochK and StochD instead.
    
    weekly / monthly charts are not affected by intraday compression 
    settingsin preferences any more and always use last available day date for 
    time stamp of time-compressed bar. 
    
    
    Pref: Misc: auto-hide timeout field: added check for allowed values 
    from 1...32
    
    
    TimeFrameSet( interval ) function implemented- 
    replaces current price/volume arrays: open, high, low, close, volume, 
    openint, avg with time-compressed bars of specified interval once you 
    switched to a different time frame all calculations and built-in indicators 
    operate on selected time frame. To get back to original interval call 
    TimeFrameRestore() funciton.
    
    TimeFrameRestore()- restores price arrays replaced 
    by SetTimeFrame. 
    Note that only OHLC, V, OI and Avg built-in variables are restored to 
    original time frame when you call TimeFrameRestore(). All other variables 
    created when being in different time frame remain compressed. To de-compress 
    them to original interval use TimeFrameExpand
    
    TimeFrameCompress( array, interval, mode = 
    compressLast )- compresses single array to given interval using given 
    mode, available modes:compressLast - last (close) value of the array 
    within intervalcompressOpen - open value of the array within 
    intervalcompressHigh - highest value of the array within 
    intervalcompressLow - lowest value of the array within 
    intervalcompressVolume - sum values of the array within 
    interval
    
    TimeFrameExpand( array, interval, mode = expandLast 
    )- expands time-compressed array from 'interval' time 
    frame('interval' must match the value used in TimeFrameCompress or 
    TimeFrameSet)Available modes:
    
      
      expandLast - the compressed value is expanded starting from last bar 
      within given period (so for example weekly close/high/low is available on 
      Friday's bar)
      
      expandFirst - the compressed value is expanded starting from first 
      bar within given period(so for example weekly open is available from 
      Monday's bar)
      expandPoint - the resulting array gets not empty values only for the 
      last bar within given period (all remaining bars are Null 
      (empty))Caveat: expandFirst used on price different than open may look 
      into the future.For example if you create weekly HIGH series, 
      expanding it to daily interval using expandFirst will enable you to know 
      on MONDAY what was the high for entire week.graph0 = 
      TimeFrameExpand( TimeFrameCompress( Close, inWeekly, compressLast ), 
      inWeekly, expandLast );graph1 = TimeFrameExpand( TimeFrameCompress( 
      Open, inWeekly, compressOpen ), inWeekly, expandFirst 
);
    
    TimeFrameGetPrice( pricefield, interval, shift = 0, 
    mode = expandFirst );- references OHLCV fields from other time 
    frames.This works immediatelly without need to call 
    TimeFrameSetTimeFrameGetPrice( "O", inWeekly, -1 ) 
    - gives you previous week OPEN priceTimeFrameGetPrice( "C", 
    inWeekly, -3 ) - gives you weekly Close price 3 weeks 
    agoTimeFrameGetPrice( "H", inWeekly, -2 ) - gives you 
    weekly High price 2 weeks agoTimeFrameGetPrice( "O", inWeekly, 0 
    ) - gives you this week open price.TimeFrameGetPrice( "H", 
    inDaily, -1 ) - gives previous day high when working on intraday 
    dataPrice field is one of the following"O", "H", "L", "C", 
    "V", "I" (open interest)Shift works as in Ref() function but it is 
    applied to compressed time frame.Note these functions work like these 3 
    nested functionsTimeFrameExpand( Ref( TimeFrameCompress( array, 
    interval, compress(depending on field used) ), shift ), interval, 
    expandFirst )therefore if shift = 0 compressed data may look into 
    the future ( weekly high can be known on monday ). If you want to write a 
    trading system using this function please make sure to reference PAST data 
    by using negative shift value.The only difference is that 
    TimeFrameGetPrice is 2x faster than nested Expand/Compress.
    
    new interval / timeframe constants:in1Minute = 
    60in5Minute = 5 * 60 in15Minute = 
    15 * 60 inHourly = 3600 inDaily = 
    24 * 3600inWeekly = 5 * 24 * 3600 
    inMonthly = 25 * 24 * 3600 
    compressLast = 0 
    compressOpen = 1 compressHigh = 2 
    compressLow = 3 compressVolume = 4 
    expandLast = 0 expandFirst = 1 
    expandPoint = 2 
    
    SetForeign( 'ticker' )- replaces current 
    price/volume arrays with those of foreign security, returns True if ticker 
    exists, False otherwise.If ticker does not exist (and function returns 
    false) price arrays are not changed at all.Equivalent to the 
    following sequence:C = Foreign( "ticker", "C" );O = Foreign( 
    "ticker", "O" );H = Foreign( "ticker", "H" );L = Foreign( "ticker", 
    "L" );V = Foreign( "ticker", "V" );OI = Foreign( "ticker", "I" 
    );Avg = ( C + H + L )/3;but 6x faster (SetForeign takes 
    about the same time as single foreign). To restore original prices 
    callRestorePriceArrays();EXAMPLE:SetForeign( "MSFT" 
    );dm = MACD(); // dm holds MACD of MSFT regardless of currently selected 
    symbolRestorePriceArrays();Plot( dm, "MACD of MSFT", colorRed 
    );Plot( MACD(), "MACD of " + Name(), colorBlue );
    
    RestorePriceArrays();restores arrays overwritten 
    by SetForeign/TimeFrameSet
  HOW TO REPORT BUGS
  If you experience any problem with this beta version please send detailed 
  description of the problem (especially the steps needed to reproduce it) to <A 
  href="">bugs@xxxxxxxxxxxxx Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.