Showing posts with label 2. PTKT. Show all posts
Showing posts with label 2. PTKT. Show all posts

10.5.09

Cập nhật thông tin cơ bản vào amibrocker

SYNTAX GetFnData("field")
RETURNS NUMBER
FUNCTION GetFnData allows accessing fundamental data from Information window (View->Information) "field" parameter can be one of the following:
  • "EPS"
  • "EPSEstCurrentYear"
  • "EPSEstNextYear"
  • "EPSEstNextQuarter"
  • "PEGRatio"
  • "SharesFloat"
  • "SharesOut"
  • "DividendPayDate"
  • "ExDividendDate"
  • "BookValuePerShare"
  • "DividendPerShare"
  • "ProfitMargin"
  • "OperatingMargin"
  • "OneYearTargetPrice"
  • "ReturnOnAssets"
  • "ReturnOnEquity"
  • "QtrlyRevenueGrowth"
  • "GrossProfitPerShare"
  • "SalesPerShare"
  • "EBITDAPerShare"
  • "QtrlyEarningsGrowth"
  • "InsiderHoldPercent"
  • "InstitutionHoldPercent"
  • "SharesShort"
  • "SharesShortPrevMonth"
  • "ForwardDividendPerShare"
  • "ForwardEPS"
  • "OperatingCashFlow"
  • "LeveredFreeCashFlow"
  • "Beta"
  • "LastSplitRatio"
  • "LastSplitDate"
EXAMPLE AddColumn( Close / GetFnData( "EPS" ) , "Current P/E ratio" );
AddColumn( Close / GetFnData( "EPSEstNextYear" ) , "Est. Next Year P/E ratio" );
Filter = Status("lastbarinrange");
SEE ALSO GetRTData() function , GetRTDataForeign() function

References:

The GetFnData function is used in the following formulas in AFL on-line library:

    More information:

    Updated on-line reference

    IMPORTING FUNDAMENTAL DATA FROM OTHER SOURCES

    AmiBroker allows also to import fundamentals using its flexible ASCII importer and/or OLE interface as all new fields are exposed as properties of Stock object.

    ASCII importer $FORMAT command now supports the following extra fields for fundamental data:

    DIV_PAY_DATE
    EX_DIV_DATE
    LAST_SPLIT_DATE
    LAST_SPLIT_RATIO
    EPS
    EPS_EST_CUR_YEAR 
    EPS_EST_NEXT_YEAR 
    EPS_EST_NEXT_QTR 
    FORWARD_EPS 
    PEG_RATIO 
    BOOK_VALUE (requires SHARES_OUT to be specified as well)
    BOOK_VALUE_PER_SHARE 
    EBITDA 
    PRICE_TO_SALES (requires CLOSE to be specified as well)
    PRICE_TO_EARNINGS (requires CLOSE to be specified as well)
    PRICE_TO_BV (requires CLOSE to be specified as well)
    FORWARD_PE (requires CLOSE to be specified as well)
    REVENUE 
    SHARES_SHORT 
    DIVIDEND 
    ONE_YEAR_TARGET 
    MARKET_CAP (requires CLOSE to be specified as well - it is used to calculate shares outstanding)
    SHARES_FLOAT 
    SHARES_OUT 
    PROFIT_MARGIN 
    OPERATING_MARGIN 
    RETURN_ON_ASSETS 
    RETURN_ON_EQUITY 
    QTRLY_REVENUE_GROWTH 
    GROSS_PROFIT 
    QTRLY_EARNINGS_GROWTH 
    INSIDER_HOLD_PERCENT 
    INSTIT_HOLD_PERCENT 
    SHARES_SHORT_PREV 
    FORWARD_DIV 
    OPERATING_CASH_FLOW 
    FREE_CASH_FLOW 
    BETA

    Note that if you want to import only fundamental data with ASCII importer (without quotes) you need to use $NOQUOTES 1 command. See Formats\aqfe.format and Formats\aqfn.format files for example usage - these are files actually used by AmiQuote to implement automatic import of fundamental data downloaded from Yahoo.

    The names of extra properties of Stock object are the same as used by GetFnData function and they are listed in detail in OLE objects reference.

    9.5.09

    Get Data CC NN

    File GetDataCCNN.rar dùng đẩ tạo các files số liệu dùng cho MS và AMI: Cung cầu (CC_dd.mm.yyyy.xls), GDNN ((NN_dd.mm.yyyy.xls) và Room NN (RR_dd.mm.yyyy.xls). Trong đó: dd - 2 chữ số ngày, mm - 2 chữ số tháng, yyyy - 4 chữ số năm.
    Cấu trúc files như sau:
    - File data Cung cầu CC_dd.mm.yyyy.xls:
    Ticker: “CC_” + Mã cổ phiếu.
    Date: Ngày giao dịch.
    OPEN= Số lệnh mua
    HIGH = Max (Số lệnh mua, số lệnh bán)
    LOW = Min (Số lệnh mua, số lệnh bán)
    CLOSE = Số lệnh bán
    VOLUME = KL Mua
    OI = KL bán.
    - File data GDNN NN_dd.mm.yyyy.xls:
    Ticker: "NN_" + Mã Cổ phiếu.
    Date: Ngày giao dịch
    OPEN: Khối lượng mua
    HIGH: Max (KL Mua, KL bán)
    LOW: Min (KL Mua, KL bán)
    CLOSE: Khối lượng bán
    VOLUME: Giá trị mua
    OI: Giá trị bán

    - File data Room NN RR_dd.mm.yyyy.xls:
    OPEN = % NN nắm giữ so với toàn TT
    HIGH: Max (OPEN, CLOSE)
    LOW: Min (OPEN, CLOSE)
    CLOSE = % còn được phép mua/Tổng Room
    VOLUME = KLCP NN đang giữ
    OI = KLCP Room còn lại (NN còn được phép mua)
    Cách sử dụng (rất đơn giản):
    Chờ tới giờ trang web fpts http://fpts.com.vn/user/stock/ndtnn hoặc http://fpts.com.vn/user/stock/lich-su/ có data đầu đủ.
    - Mở file GetDataCCNN.xls
    - Nhập ngày cần data vào cell A3, theo cấu trúc yyyymmdd (ko có khoảng cách giữa các chữ số).
    - Nhấp chuột vào nút Get Data.
    - Hết. Các files output sẽ được lưu vào folder có đường dẫn được nhập vào cell A5 hoặc vào folder hiện hành (nếu ko có đường dẫn trong A5). Nếu nhập sai thên đường dẫn files sẽ ra ko đúng tên.

    File GetTxtDataCCNN.xls có cộng dụng tương tự GetDataCCNN.xls, chỉ khác là files xuất ra có dạng text (ASCII) có thể add thẳng vào Ami, ko cần thông qua MS. Cách sử dụng hoàn toàn giống như cách sử dụng GetDataCCNN.xls.
    ---------------------------------------------------------------------
    Hum nay (12/02/2009) em gộp lun 2 files GetTxtDataCCNN.xls dzà GetDataCCNN.xls dzô chung 1 file GetDataCCNNRR.xls. Cách sử dụng tương tự như trên, chỉ có thêm checkbox Chọn lấy xls data hay txt data hoặc cả 2.
    Em dzừa mới bỏ hết mí files cũ. Chỉ để lại 1 file cho khỏi lẩn lộn (17:36 ngày 26-02-2009)
    Hum nay (01/03/09) em bổ sung thêm file GetOldDataCCNNRR.rar sử dụng cho việc lấy data nhiều ngày liên tiếp.
    Và update Số lượng CP NY (dùng tính các chỉ số % cho Room - cột O & C)
    --------------------------------------------------------------------------
    Hum trước em mới xóa file DataProcess.xls thì nay (07/03/2009) lại phải đưa trở dzô tại dzì file GetDataCCNNRR.xls bi h ko lấy data từ FPTs tự động được nữa!
    Cách sử dụng xin bác xem ở đây: http://vinase.com/forums/showthread.php?t=2394&page=21
    File Đính Kèm
    Download : rar GetOldDataCCNNRR.rar (662.4 KB, 67 lần tải)
    Download : rar GetDataCCNNRR.rar (175.8 KB, 55 lần tải)
    Download : xls DataProcess.xls (282.0 KB, 26 lần tải)

    thay đổi nội dung bởi: trungnghia, 07-03-2009 lúc 11:10 PM. Lý do: Add thêm file DataProcess.xls mới nhất 07.03.09.

    19.4.09

    Ôn lại lý thuyết sóng Elliot

    Five wave pattern (dominant trend) Three wave pattern (corrective trend)
    Wave 1: Wave one is rarely obvious at its inception. When the first wave of a new bull market begins, the fundamental news is almost universally negative. The previous trend is considered still strongly in force. Fundamental analysts continue to revise their earnings estimates lower; the economy probably does not look strong. Sentiment surveys are decidedly bearish, put options are in vogue, and implied volatility in the options market is high. Volume might increase a bit as prices rise, but not by enough to alert many technical analysts. Wave A: Corrections are typically harder to identify than impulse moves. In wave A of a bear market, the fundamental news is usually still positive. Most analysts see the drop as a correction in a still-active bull market. Some technical indicators that accompany wave A include increased volume, rising implied volatility in the options markets and possibly a turn higher in open interest in related futures markets.
    Wave 2: Wave two corrects wave one, but can never extend beyond the starting point of wave one. Typically, the news is still bad. As prices retest the prior low, bearish sentiment quickly builds, and "the crowd" haughtily reminds all that the bear market is still deeply ensconced. Still, some positive signs appear for those who are looking: volume should be lower during wave two than during wave one, prices usually do not retrace more than 61.8% (see Fibonacci section below) of the wave one gains, and prices should fall in a three wave pattern. Wave B: Prices reverse higher, which many see as a resumption of the now long-gone bull market. Those familiar with classical technical analysis may see the peak as the right shoulder of a head and shoulders reversal pattern. The volume during wave B should be lower than in wave A. By this point, fundamentals are probably no longer improving, but they most likely have not yet turned negative.
    Wave 3: Wave three is usually the largest and most powerful wave in a trend (although some research suggests that in commodity markets, wave five is the largest). The news is now positive and fundamental analysts start to raise earnings estimates. Prices rise quickly, corrections are short-lived and shallow. Anyone looking to "get in on a pullback" will likely miss the boat. As wave three starts, the news is probably still bearish, and most market players remain negative; but by wave three's midpoint, "the crowd" will often join the new bullish trend. Wave three often extends wave one by a ratio of 1.618:1. Wave C: Prices move impulsively lower in five waves. Volume picks up, and by the third leg of wave C, almost everyone realizes that a bear market is firmly entrenched. Wave C is typically at least as large as wave A and often extends to 1.618 times wave A or beyond.
    Wave 4: Wave four is typically clearly corrective. Prices may meander sideways for an extended period, and wave four typically retraces less than 38.2% of wave three. Volume is well below than that of wave three. This is a good place to buy a pull back if you understand the potential ahead for wave 5. Still, the most distinguishing feature of fourth waves is that they often prove very difficult to count.
    Wave 5: Wave five is the final leg in the direction of the dominant trend. The news is almost universally positive and everyone is bullish. Unfortunately, this is when many average investors finally buy in, right before the top. Volume is lower in wave five than in wave three, and many momentum indicators start to show divergences (prices reach a new high, the indicator does not reach a new peak). At the end of a major bull market, bears may very well be ridiculed (recall how forecasts for a top in the stock market during 2000 were received).