Hi, I am looking for software to create and manipulate composite easily. I am working with EOD data, not real time or intraday. For example, I would like to create a composite of several securities and compare it with another composite: relative strength, correlation. Not backtesting planned yet. Reading the forum, it seems that Amibroker and Quantshare are the most suitable software for my request. Could you please confirm? Is there software you would advise?
Hi guys, I just realised that you had arguments between pros and cons about Amibroker and Quantshare. I really do not want to get into this. Is there another software on the market that handles composite well?
Thanks for your feedback. I did it on excel on a small scale. For calculations, excel is good and highly flexible. My issue is in the input and output. Input: maintaining a clean database that is automatically updated. Output: charting the results, if possible with good graphics. Softwares have these functionnalities built in. If feasible, I prefer to use my energy on the calculation core and outsource the input and output management to a third party software.
I will write you private message... Input: For example XLQ plugin is nice and cheap solution. Output: Everything can be charted in Excel as far as I know... What is exact obstacle for you?
Besides other trading softwares I'm also using AmiBroekr for quite a few years so I may give some inside on how to create Composites via AmiBroker. There you have two options to create them 1. using AddToComposite (in Indicator mode, Exploration mode, Scan mode, Backtest mode, ...), in below example code I'm using Indicator mode. 2. using Static Variables The example code below includes both upper methods and it is applied in an indicator pane. In the code example you could remove trigger condition. Then the whole code within braces is calculated continuously. Triggers in the code are examples. Other triggers may be key strokes and/or mouse clicks, or new calculation at every new bar start in realtime mode or a signal or .... If using AddtoComposite and you wanna call the created composite anywhere within the application you use Foreign( "composite name", array) and if using Static variables you call the composite anywhere within the application using StaticVarGet( "composite name" ) Static variables advantage is that they are faster. Code: <code>[COLOR=#0000ff][B]<code>[COLOR=#008000]// example to create composites via Static Variables or AddToComposite [/COLOR]</code>[/B]<code></code>[/COLOR]</code><code>[COLOR=#008000]// by ST.M@elitetrader.com [/COLOR] [COLOR=#0000ff][B]SetBarsRequired[/B][/COLOR]( [COLOR=#800080]1000[/COLOR], [COLOR=#800080]0[/COLOR] ); WL = [COLOR=#0000ff][B]Param[/B][/COLOR]( [COLOR=#800080]"Category Number"[/COLOR], [COLOR=#800080]0[/COLOR], [COLOR=#800080]0[/COLOR], [COLOR=#800080]64[/COLOR], [COLOR=#800080]1[/COLOR] ); Periods = [COLOR=#0000ff][B]Param[/B][/COLOR]( [COLOR=#800080]"MA Periods"[/COLOR], [COLOR=#800080]50[/COLOR], [COLOR=#800080]10[/COLOR], [COLOR=#800080]200[/COLOR], [COLOR=#800080]10[/COLOR] ); [COLOR=#008000]// optional setting in regards to first method below (using static variables) // SetOption( "StaticVarAutoSave", intervale = 60 ); // second interval storage of persistent variables, 0 - disabled [/COLOR] [COLOR=#008000]// set category of symbols [/COLOR]category = [B]categoryWatchlist[/B]; categoryname = [COLOR=#0000ff][B]CategoryGetName[/B][/COLOR]( category, WL ); compositename = [COLOR=#800080]"Percent_Above_Composite_"[/COLOR] + categoryname; [COLOR=#0000ff][B]RequestTimedRefresh[/B][/COLOR]( sec = [COLOR=#800080]5[/COLOR], onlyvisible = [B]False[/B] );[COLOR=#008000]// refresh chart every x seconds, 0 - disabled // trigger(s) example [/COLOR]trigger = [COLOR=#008000]/*refers to RequestTimedRefresh*/[/COLOR][COLOR=#0000ff][B]Status[/B][/COLOR]( [COLOR=#800080]"redrawaction"[/COLOR] ) [COLOR=#800040][B]OR[/B][/COLOR] [COLOR=#008000]/*button click in paramters dialog*/[/COLOR][COLOR=#0000ff][B]ParamTrigger[/B][/COLOR]( [COLOR=#800080]"Calculate Composite"[/COLOR], [COLOR=#800080]"CLICK HERE"[/COLOR] ); [COLOR=#800040][B]if[/B][/COLOR] ( trigger ) { </code><code><code> list = [COLOR=#0000ff][B]CategoryGetSymbols[/B][/COLOR]( category, WL ); count = [COLOR=#0000ff][B]StrCount[/B][/COLOR]( list, [COLOR=#800080]","[/COLOR] ) + [COLOR=#800080]1[/COLOR]; [COLOR=#008000]// count symbols of category [/COLOR] [COLOR=#008000]// iterate through set filled watchlist [/COLOR] [COLOR=#008000]// to retrieve comma-separated list of symbols in watch list [/COLOR] above = [COLOR=#800080]0[/COLOR]; </code> [COLOR=#800040][B]for[/B][/COLOR] ( i = [COLOR=#800080]0[/COLOR]; ( sym = [COLOR=#0000ff][B]StrExtract[/B][/COLOR]( list, i ) ) != [COLOR=#800080]""[/COLOR]; i++ ) { [COLOR=#0000ff][B]SetForeign[/B][/COLOR]( sym, [B]True[/B], [B]True[/B] ); above += [B]Close[/B] > [COLOR=#0000ff][B]MA[/B][/COLOR]( [B]Close[/B], Periods );[COLOR=#008000]// sum up true conditions of Price above MA [/COLOR] [COLOR=#0000ff][B]RestorePriceArrays[/B][/COLOR](); } percent_above = [COLOR=#800080]100[/COLOR] * above / count;[COLOR=#008000]// calculate percentage above MA [/COLOR] [COLOR=#008000]// two methods to create composite ################## [/COLOR] [COLOR=#008000]// first one [/COLOR] [COLOR=#0000ff][B]StaticVarSet[/B][/COLOR]( compositename, percent_above, PersistentStorage = [B]True[/B] ); [COLOR=#008000]// store composite [/COLOR] [COLOR=#008000]// second one [/COLOR] [COLOR=#008000]//AddToComposite( percent_above, "~" + compositename, "C", atcFlagDefaults | atcFlagEnableInIndicator );// store composite [/COLOR]} [COLOR=#008000]// call composite via two methods ################# // first method [/COLOR]callcomposite = [COLOR=#0000ff][B]StaticVarGet[/B][/COLOR]( compositename ); [COLOR=#008000]// second method //callcomposite = Foreign( "~" + compositename, "C" ); [/COLOR] [COLOR=#0000ff][B]Plot[/B][/COLOR]( callcomposite, compositename, [B]colorRed[/B], [B]styleLine[/B], [B]Null[/B], [B]Null[/B], [COLOR=#800080]0[/COLOR], [COLOR=#800080]0[/COLOR], -[COLOR=#800080]50[/COLOR] ); </code> <code> </code>
Here is another method using Exploration mode. It uses the same composite calculation example as previous code and if paramters WL and periods are the same ones set then it calculates same composite. Code: <code>WL = [COLOR=#800080]0[/COLOR]; [COLOR=#008000]// WL number [/COLOR]Periods = [COLOR=#800080]50[/COLOR]; [COLOR=#008000]// MA periods [/COLOR] category = [B]categoryWatchlist[/B]; categoryname = [COLOR=#0000ff][B]CategoryGetName[/B][/COLOR]( category, WL ); compositename = [COLOR=#800080]"~Percent_Above_Composite_"[/COLOR] + categoryname;[COLOR=#008000]// tilde required at start of comp name [/COLOR] atcmode = [B]atcFlagDefaults[/B] | [B]atcFlagEnableInExplore[/B]; [B]Filter[/B] = [COLOR=#0000ff][B]InWatchList[/B][/COLOR]( WL ); count = [COLOR=#0000ff][B]StrCount[/B][/COLOR]( [COLOR=#0000ff][B]CategoryGetSymbols[/B][/COLOR]( category, WL ), [COLOR=#800080]","[/COLOR] ) + [COLOR=#800080]1[/COLOR]; [COLOR=#800040][B]if[/B][/COLOR] ( [COLOR=#0000ff][B]Status[/B][/COLOR]( [COLOR=#800080]"action"[/COLOR] ) == [B]actionExplore[/B] ) { above = [B]Close[/B] > [COLOR=#0000ff][B]MA[/B][/COLOR]( [B]Close[/B], Periods );[COLOR=#008000]// sum up true conditions [/COLOR] percent_above = [COLOR=#800080]100[/COLOR] * above / count;[COLOR=#008000]// calculate percentage above MA [/COLOR] [COLOR=#0000ff][B]AddToComposite[/B][/COLOR]( percent_above, compositename, [COLOR=#800080]"C"[/COLOR], atcmode );[COLOR=#008000]// store composite [/COLOR]} callcomposite = [COLOR=#0000ff][B]Foreign[/B][/COLOR]( compositename, [COLOR=#800080]"C"[/COLOR] ); [COLOR=#0000ff][B]Plot[/B][/COLOR]( callcomposite, compositename, [B]colorRed[/B], [B]styleLine[/B], [B]Null[/B], [B]Null[/B], [COLOR=#800080]0[/COLOR], [COLOR=#800080]0[/COLOR], -[COLOR=#800080]50[/COLOR] );</code>
Doh. There is a wrongly placed comment in the code. Corrected placement . . . <code>// retrieve comma-separated list of symbols of watch list list = CategoryGetSymbols( category, WL ); // count symbols of category count = StrCount( list, "," ) + 1; // iterate through set filled watchlist above = 0; for ( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )</code> . . .
In case you still need it I have made a change to the first code. That one as well as the second one use a static cont ( count = StrCount( list, "," ) + 1 ) of symbols but it may occur that symbols of a category have different availability of data. That's why the previous symbol count line of those two code examples was not the best one as it uses the same number of symbols every time. I have used it for the sake of simplicity. The upper second code posted uses static too. So there one would have to change symbol counting also. Here is a better one which counts symbols dynamically (in regards to first code) Code: <code>[COLOR=#008000]// example to create composites via Static Variables or AddtoComposite [/COLOR] [COLOR=#008000]// by ST.M@elitetrader.com [/COLOR] [COLOR=#0000ff][B]SetBarsRequired[/B][/COLOR]( [COLOR=#800080]10000[/COLOR], [COLOR=#800080]0[/COLOR] ); WL = [COLOR=#0000ff][B]Param[/B][/COLOR]( [COLOR=#800080]"Category Number"[/COLOR], [COLOR=#800080]0[/COLOR], [COLOR=#800080]0[/COLOR], [COLOR=#800080]64[/COLOR], [COLOR=#800080]1[/COLOR] ); Periods = [COLOR=#0000ff][B]Param[/B][/COLOR]( [COLOR=#800080]"MA Periods"[/COLOR], [COLOR=#800080]50[/COLOR], [COLOR=#800080]10[/COLOR], [COLOR=#800080]200[/COLOR], [COLOR=#800080]10[/COLOR] ); [COLOR=#008000]// optional setting in regards to first method below (via static variables) // SetOption( "StaticVarAutoSave", intervale = 60 ); // seconds interval storage of persistent variables, 0 - disabled [/COLOR] [COLOR=#008000]// set category of symbols [/COLOR]category = [B]categoryWatchlist[/B]; categoryname = [COLOR=#0000ff][B]CategoryGetName[/B][/COLOR]( category, WL ); compositename = [COLOR=#800080]"~PercentAboveMA_Composite_"[/COLOR] + categoryname; [COLOR=#008000]// refresh chart every x seconds, 0 - disabled [/COLOR][COLOR=#0000ff][B]RequestTimedRefresh[/B][/COLOR]( sec = [COLOR=#800080]5[/COLOR], onlyvisible = [B]False[/B] ); [COLOR=#008000]// trigger(s) example [/COLOR]trigger = [COLOR=#008000]/*refers to RequestTimedRefresh*/[/COLOR] [COLOR=#0000ff][B]Status[/B][/COLOR]( [COLOR=#800080]"redrawaction"[/COLOR] ) [COLOR=#800040][B]OR[/B][/COLOR] [COLOR=#008000]/*button click in parameters dialog*/[/COLOR] [COLOR=#0000ff][B]ParamTrigger[/B][/COLOR]( [COLOR=#800080]"Calculate Composite"[/COLOR], [COLOR=#800080]"CLICK HERE"[/COLOR] ); [COLOR=#800040][B]if[/B][/COLOR] ( trigger ) { [COLOR=#008000]// retrieve comma-separated list of symbols of watch list [/COLOR] list = [COLOR=#0000ff][B]CategoryGetSymbols[/B][/COLOR]( category, WL ); [COLOR=#008000]// iterate through set filled watchlist [/COLOR] above = [COLOR=#800080]0[/COLOR]; count = [COLOR=#800080]0[/COLOR]; [COLOR=#800040][B]for[/B][/COLOR] ( i = [COLOR=#800080]0[/COLOR]; ( sym = [COLOR=#0000ff][B]StrExtract[/B][/COLOR]( list, i ) ) != [COLOR=#800080]""[/COLOR]; i++ ) { [COLOR=#0000ff][B]SetForeign[/B][/COLOR]( sym, [B]True[/B], [B]True[/B] ); [COLOR=#008000]// to account for symbols with different length or availabilty of data [/COLOR] notnull = [COLOR=#800040][B]NOT[/B][/COLOR] [COLOR=#0000ff][B]IsNull[/B][/COLOR]( [B]C[/B] ); [COLOR=#008000]// sum up true conditions of price above MA [/COLOR] above += [B]Close[/B] > [COLOR=#0000ff][B]MA[/B][/COLOR]( [B]Close[/B], Periods ) [COLOR=#800040][B]AND[/B][/COLOR] notnull; [COLOR=#008000]// dynamic count of symbols of category based on available data [/COLOR] count += notnull; [COLOR=#0000ff][B]RestorePriceArrays[/B][/COLOR](); } [COLOR=#008000]// calculate percentage above MA [/COLOR] percent_above = [COLOR=#800080]100[/COLOR] * above / count; [COLOR=#008000]// two methods to store composite ################## [/COLOR] [COLOR=#008000]// first one [/COLOR] [COLOR=#0000ff][B]StaticVarSet[/B][/COLOR]( compositename, percent_above, PersistentStorage = [B]True[/B] ); [COLOR=#008000]// second one [/COLOR] [COLOR=#008000]//AddToComposite( percent_above, compositename, "C", atcFlagDefaults | atcFlagEnableInIndicator ); [/COLOR]} [COLOR=#008000]// call composite via two methods ###################### // first method [/COLOR]callcomposite = [COLOR=#0000ff][B]StaticVarGet[/B][/COLOR]( compositename ); [COLOR=#008000]// second method // callcomposite = Foreign( compositename, "C" ); [/COLOR] [COLOR=#0000ff][B]Plot[/B][/COLOR]( callcomposite, compositename, [B]colorRed[/B], [B]styleHistogram[/B], [B]Null[/B], [B]Null[/B], [COLOR=#800080]0[/COLOR], [COLOR=#800080]0[/COLOR], -[COLOR=#800080]60[/COLOR] );</code>