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

Re: [amibroker] Re: Composite Sector Charts



PureBytes Links

Trading Reference Links

Hi Deon

Simply want to thank you for such a code.  You should put it in the AFL 
Library.  The result is very impressive and usefull.

Once again, thanks for this very nice code.

Claude Marc-Aurčle



----- Original Message ----- 
From: "dentalsi90" <dentalsi90@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, January 18, 2006 5:37 PM
Subject: [amibroker] Re: Composite Sector Charts


> Hi Graham
>
> Thank you very much for your suggestion.
>
> I have changed my code accordingly and double checked that I run the
> code in SCAN.
> The scan executed very slowly, after 2 hours 54 minutes, it had
> progressed to 48% on Task 1. And since progress slowed even further
> and my computer indicated a shortfall in virtual memory, I decided
> to cancel the scan.
> I experimentally changed Buy back to Buy = 0; and ran SCAN again.
> The Scan completed in approximately 24 minutes, but only Task 1
> executed, Task 2 did not. I confirmed that the composite tickers
> created in Task 1 do indeed contain total OHLCV values for each
> sector.
> I appreciate your earlier input. Do you or someone else have any
> suggestion given this new information?
>
> Best regards
>
> Deon Hildebrand
>
> --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
>>
>> try using IF instead
>> If( Task ==1)
>> {
>> AddToComposite(  L, sym, "L",
> atcFlagDefaults|atcFlagEnableInBacktest );
>> other statements for task 1
>>
>> }
>>
>> If( Task ==2)
>> {
>> /* Average values for the Energy sector */
>>
>> EAveLow = Foreign( "~Energy", "L" )/ Foreign( "~Energy", "I" );
>> etc
>>
>>
>> AddToComposite(  EAveLow, "~AveEnergy", "L",
>> atcFlagDefaults|atcFlagEnableInBacktest );
>> etc
>>
>> }
>>
>> It also states you ran optimise or backtest?
>> Just have
>> Buy=1;
>> and run Scan
>>
>>
>> --
>> Cheers
>> Graham
>> AB-Write >< Professional AFL Writing Service
>> Yes, I write AFL code to your requirements
>> http://e-wire.net.au/~eb_kavan/ab_write.htm
>>
>>
>>
>> On 1/18/06, dentalsi90 <dentalsi90@xxxx> wrote:
>> >
>> > Hello Everyone
>> >
>> > My goal is to create composite ticker containing composite OHLCV
>> > values for the 12 sectors (average values not total values). I
> want
>> > to run SCAN only once, so I am trying to use a task scheduler.
>> >
>> > Unfortunately, I get an error message everytime I run the code in
>> > Amibroker. I have no idea what may be wrong. Please have a look,
> any
>> > suggestions will be most appreciated. I give you my steps, the
> code
>> > and details of the error message. Apologies for
> the 'lengthyness' of
>> > the message.
>> >
>> > Best Regards
>> >
>> > Deon Hildebrand
>> >
>> >
>> > My steps....
>> >    Send to Automatic Analysis-> [ Apply to ->use filter ->
> stocks,
>> >  Range -> all quotations ] -> Optimize.
>> >
>> >
>> > My code...
>> >
>> > Task = Optimize("Task", 1, 1, 2, 1 );
>> >
>> > sym = "~" + SectorID (1);
>> >
>> > Buy = Sell = Short = Cover = 0;
>> >
>> > Filter = 1;
>> >
>> > AddToComposite( IIf( Task ==1, L, 0 ), sym, "L",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==1, O, 0 ), sym, "O",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==1, H, 0 ), sym, "H",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==1, C, 0 ), sym, "C",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==1, V, 0 ), sym, "V",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==1, 1, 0 ), sym, "I",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> >
>> >
>> > /* Average values for the Energy sector */
>> >
>> > EAveLow = Foreign( "~Energy", "L" )/ Foreign( "~Energy", "I" );
>> >
>> > EAveOpen = Foreign( "~Energy", "O" )/ Foreign( "~Energy", "I" );
>> >
>> > EAveHigh = Foreign( "~Energy", "H" )/ Foreign( "~Energy", "I" );
>> >
>> > EAveClose = Foreign( "~Energy", "C" )/ Foreign( "~Energy", "I" );
>> >
>> > EAveVolume = Foreign( "~Energy", "V" )/ Foreign
> ( "~Energy", "I" );
>> >
>> > /*Average Values for the Financial Sector */
>> >
>> > FAveLow = Foreign( "~Financial", "L" )/ Foreign
> ( "~Financial", "I" );
>> >
>> > FAveOpen = Foreign( "~Financial", "O" )/ Foreign
>> > ( "~Financial", "I" );
>> >
>> > FAveHigh = Foreign( "~Financial", "H" )/ Foreign
>> > ( "~Financial", "I" );
>> >
>> > FAveClose = Foreign( "~Financial", "C" )/ Foreign
>> > ( "~Financial", "I" );
>> >
>> > FAveVolume = Foreign( "~Financial", "V" )/ Foreign
>> > ( "~Financial", "I" );
>> >
>> >
>> >
>> > AddToComposite( IIf( Task ==2, EAveLow, 0 ), "~AveEnergy", "L",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, EAveOpen, 0 ), "~AveEnergy", "O",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, EAveHigh, 0 ), "~AveEnergy", "H",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, EAveClose, 0 ), "~AveEnergy", "C",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, EAveVolume,
> 0 ), "~AveEnergy", "V",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, FAveLow,
> 0 ), "~AveFinancial", "L",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, FAveOpen,
> 0 ), "~AveFinancial", "O",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, FAveHigh,
> 0 ), "~AveFinancial", "H",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, FAveClose,
> 0 ), "~AveFinancial", "C",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> > AddToComposite( IIf( Task ==2, FAveVolume,
>> > 0 ), "~AveFinancial", "V",
>> > atcFlagDefaults|atcFlagEnableInBacktest );
>> >
>> >
>> >
>> > Details of the error I get:
>> >
>> > Details:
>> > AmiBroker version 4.70.5.4272
>> >  ( cooltool.dll 4.70.5,  mfc42.dll 6.2.4131,  msvcrt.dll
> 7.0.2600 )
>> >
>> > Microsoft Windows XP version 5.1 (Build 2600)
>> > Service Pack 2.0
>> > Common Controls: 6.0
>> >
>> > Unhandled exception
>> > Type: CSysException
>> > Code: c0000005
>> > Description: ACCESS VIOLATION
>> > Address: 492096
>> >
>> >
>> > AFL Parser status:
>> > Processing stage: NONE
>> > Formula ID: 0 ()
>> > Action 5 (BACKTEST)
>> >
>> > Additional information:
>> >
>> > Number of stock loaded: 33193
>> > Currently selected stock: !NDX
>> > Number of quotes (current stock): 2897
>> >
>> > Workspace:
>> > Data source = QP2 , Data local mode = 2, NumBars = 3000
>> >
>> > Preferences:
>> > Data source = QP2 , Data local mode = 2, NumBars = 3000
>> >
>> > Command history:
>> > 2824 - Shows AFL formula editor--Formula Editor
>> >
>> > Cache manager stats:
>> > Number of list elements: 1188
>> > Number of map elements: 1188
>> > Hash table size: 5987
>> >
>> > Memory status:
>> >  MemoryLoad: 74 %
>> >  TotalPhys:       523620K  AvailPhys:       132728K
>> >  TotalPageFile:  1280064K  AvailPageFile:   899660K
>> >  TotalVirtual:   2097024K  AvailVirtual:   1774092K
>> >
>> > Last Windows message:
>> > HWnd: 0x902aa
>> > Msg: 0x0110
>> > wParam: 0x000b02be
>> > lParam: 0x00000000
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > Please note that this group is for discussion between users only.
>> >
>> > To get support from AmiBroker please send an e-mail directly to
>> > SUPPORT {at} amibroker.com
>> >
>> > For other support material please check also:
>> > http://www.amibroker.com/support.html
>> >
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/