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

[amibroker] Re: testing multiple systems simultaneously



PureBytes Links

Trading Reference Links

Angelo,
You can, for example, if you want to enter two trades on the same bar
just sum to size of each system on that bar, and buyprice would be the weighted average of the buyprice of the two systems for that bar
ie
size[i] = size1[i] + size2[i];
Buyprice[i] = (size1[i] * Buyprice1[i] + size2[i] * Buyprice2[i])/size[i];
I have uploaded a simple example showing you how a simple two system multiplexer can be written. 

http://www.amibroker.com/library/detail.php?id=1227

It is not based on your requirements, but nevertheless illustrate how you can pair up sell to their respective buy. It allows only 1 trades per symbol at any one time, same as the default in AB. But you can basically program any rules you want, such as yours. It would however involves sigscalein and sigscaleout as though. But once you understand loop programming, then it shouldnt be a huge problem, just a nice challenge.
PS. You cant use applystop in designing your system, you have to write stops into the loops directly.

You will notice that I havent use CBT in this example at all.
Paul.
--- In amibroker@xxxxxxxxxxxxxxx, "ang_60" <ima_cons@xxx> wrote:
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Paul Ho" <paul.tsho@> wrote:
> >
> > my suggestion does not require any cbt it invlves writing a functions using afl loops. so if know how to write for loops then u can create this solution
> > >
> >
> 
> 
> Hi Paul,
> 
> I'm always for as simple as possible solutions, but I strongly doubt 
> this can be currently done without the use of the CBT.
> 
> Just one reason: if all systems give a signal on the same bar/day, I'd expect the backtesting to trade them all (given there's enough funds and according to the posizion sizing rules) and not to use "PositionScore". That - I guess - is the better proxy of what would have happened in real time.
> 
> As far as I know (please correct me if I'm wrong), standard AFL only allows for one entry trade for every bar.
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/