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

[amibroker] Re: Help request with code



PureBytes Links

Trading Reference Links

Just in case anyone actually follows these threads this is the solution to Teds
question of a few days back. With the help of Marcin I was able to come
up with this weekly formula:

WeeklyBase = TimeFrameCompress( C, inWeekly );
SetForeign("!SPX");
TimeFrameSet( inWeekly );
RSEMA = EMA( ( WeeklyBase / C ) * 1000, 7 );
RestorePriceArrays();
RSEMA = TimeFrameExpand( RSEMA, inWeekly );
Plot( RSEMA, " WEEKLY RSEMA", colorRed, 8 );


which draws the same chart as this formula viewed with weekly display:

RS = RelStrength( "!SPX" );
RS = EMA( RS, 7 );
Plot( RS, "RS", colorRed, 8 );


Regards,
William Peters (AmiBroker Group Moderator)
www.amitools.com




Saturday, January 8, 2005, 4:21:57 PM, you wrote:



t> Thank you William for a quick responce to my problem.
t> Unfortunately using your code also produces a different weekly chart
t> than compared to when Daily/Weekly button is switched on the toolbar.

t> Regards Ted



t> --- In amibroker@xxxxxxxxxxxxxxx, William Peters 
t> <williampeters@xxxx> wrote:
>> Hi Ted,
>> 
>> You need to decompress the array to the base time interval before
>> plotting weekly RS against lower timeframe.
>> 
>> TimeFrameSet( inWeekly );
>> RS = EMA( RelStrength( "!SPX" ), 7 );
>> TimeFrameRestore();
>> 
>> RS = TimeFrameExpand( RS, inWeekly );
>> 
>> Plot( RS, " WEEKLY  RS", colorRed, 8 );
>> 
>> There is a comprehensive time frame tutorial in the AMiBroker users
>> guide in case you haven't seen it yet.
>> 
>> Regards,
>> William Peters (AmiBroker Group Moderator)
>> www.amitools.com
>> 
>> 
>> Saturday, January 8, 2005, 8:27:09 AM, you wrote:
>> 
>> t> Hi 
>> t> I am trying to plot weekly relative strength chart.
>> t> The code below is producing identical chart to a daily RS chart.
>> t> When switched D/W from toolbar charts differ. 
>> 
>> t> Am I missing something?
>> 
>> 
>> t> TimeFrameSet( inWeekly );
>> 
>> t> RS=RelStrength("SP-500");
>> t> Plot(EMA(RS,7)," WEEKLY  RS",colorred,8);
>> 
>> t> TimeFrameRestore();
>> 
>> t> Thanks 
>> t> Regards Ted






t> Check AmiBroker web page at:
t> http://www.amibroker.com/

t> Check group FAQ at:
t> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
t> Yahoo! Groups Links



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/