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

Re: [amibroker] Multiple Timeframes in the same sheet



PureBytes Links

Trading Reference Links




Hello,
 
Excerpt from the READ ME:

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 );
Hope this helps.
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE dir=ltr 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Tomasz Janeczko 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Tuesday, September 09, 2003 12:41 
  PM
  Subject: Re: [amibroker] Multiple 
  Timeframes in the same sheet
  
  Hello,
   
  To plot BARS or CANDLESTICKS you have to have FOUR ARRAYS 
  (OHLC) not ONE.
   
  Use PlotOHLC as written in the READ 
  ME file.
   
  I beg everyone <FONT color=#0000ff 
  size=6>read the READ ME file.
   
  Best regards,Tomasz Janeczkoamibroker.com
  <BLOCKQUOTE 
  >
    ----- Original Message ----- 
    <DIV 
    >From: 
    CS 
    
    To: <A title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    Sent: Tuesday, September 09, 2003 12:11 
    PM
    Subject: Re: [amibroker] Multiple 
    Timeframes in the same sheet
    
    I also tried:
    TimeFrameSet<FONT 
    color=#0000ff>(<FONT 
    size=2>inWeekly<FONT 
    face=Tahoma>);
    ec=<FONT 
    color=#0000ff><FONT 
    face=Tahoma>TimeFrameExpand<FONT 
    size=2>(Close<FONT 
    face=Tahoma>,<FONT 
    size=2>inWeekly,<FONT 
    size=2>expandPoint<FONT 
    size=2>);
    CL=<FONT 
    color=#0000ff>IIf<FONT 
    face=Tahoma>(C<FONT 
    color=#0000ff>><FONT 
    size=2>O,<FONT 
    size=2>1,<FONT 
    size=2>0<FONT face=Tahoma 
    color=#0000ff>);
    Plot<FONT 
    face=Tahoma>(<FONT 
    size=2>ec,"Weekly 
    Prices",CL<FONT 
    size=2>,styleBar<FONT 
    size=2>);
    <FONT 
    size=2> 
    <FONT 
    color=#000000>And got this bizzare weekly (second) 
    plot:
    -CS
     
    <FONT 
    color=#000000><IMG alt="" hspace=0 
    src="png00183.png" align=baseline 
    border=0>
    <BLOCKQUOTE 
    >
      ----- Original Message ----- 
      <DIV 
      >From: 
      Tomasz 
      Janeczko 
      To: <A 
      title=amibroker@xxxxxxxxxxxxxxx 
      href="">amibroker@xxxxxxxxxxxxxxx 
      
      Sent: Tuesday, September 09, 2003 
      1:19 AM
      Subject: Re: [amibroker] Multiple 
      Timeframes in the same sheet
      
      Hello,
       
      Currently as per Read Me description you have to use 
      TimeFrameExpand to 'expand' other time frame data for proper display 
      (aligning with date axis).
      Excerpt from the 4.41.1 READ ME file:
       
      
      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. <FONT 
      color=#0000ff>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)).
       
      Hope this helps.
       
      Best regards,Tomasz Janeczkoamibroker.com
      <BLOCKQUOTE 
      >
        ----- Original Message ----- 
        <DIV 
        >From: 
        CS 
        
        To: <A 
        title=amibroker@xxxxxxxxxxxxxxx 
        href="">amibroker@xxxxxxxxxxxxxxx 
        
        Sent: Tuesday, September 09, 2003 
        10:09 AM
        Subject: [amibroker] Multiple 
        Timeframes in the same sheet
        
        This composite of 3 separate pictures is what I am trying to get 
        to.
        Top is daily, middle is weekly, bottom is monthly.
        Note that the weekly and monthly date displays are correct (the 
        numbers anyway, the hash marks in weekly aren't), and that the bars 
        are NOT spread out.
        So far I haven't found a combination of time functions that 
        will allow these graphs in the same sheet with the correct dates.
        The dates either show up as all daily or all weekly or all monthly 
        depending on the periodicity selected on the toolbar.
         
        Any ideas?
         
        Thanks,
        -CS
         
         
        <IMG alt="" hspace=0 src="png00184.png" 
        align=baseline border=0><IMG alt="" hspace=0 
        src="png00185.png" align=baseline border=0><IMG 
        alt="" hspace=0 src="png00186.png" 
        align=baseline border=0>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. 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. 
      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



Attachment: Description: ""

Attachment: Description: ""

Attachment: Description: ""

Attachment: Description: "Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service."