Hi Keith,
Yeah, I saw that too and will try it out in some
code, but my main malfunction is
finding a reliable Equity for determining the
position size. when the EQUITY is used
prior to the PositionSize, It becomes bizzare.
After it is OK. Problem is, I need to access it before,
or at least within the PositionSize line for the
calculation.
Like here:
MinContracts=2;//Optimize("Min Contracts",1,1,5,1); MaxContracts=10;//Optimize("Max Contracts",20,5,25,1); Margin=MarginDeposit; PctEq=PctEq/100; PositionSize = Min( MaxContracts * Margin , Max( PctEq * Equity() , MinContracts * Margin ));
The old positionsize statement works fine, but I'll
probably convert to the new one.
Who knows, maybe some internal register for the
Equity will work better with the new SetPositionSize.
After trying all the variations of Equity I could
think of to work, I figured that I'll have to code
my own routine to keep track of the Equity for use
in the PositionSize determination.
Thanks,
-CS
----- Original Message -----
Sent: Thursday, May 28, 2009 10:15
AM
Subject: Re: [amibroker] Using Equity to
Compute Position Size
After reading Ed's post below,
I searched the User's Guide for positionsize. There is a function
SetPositionSize(array, method) which returns an array. I've never
used the function, and don't really understand how it works. However,
perhaps you can somehow use it. Maybe you can even modify the input
array on the fly to achieve your desired result.
Perhaps you can write
a loop which calculates mypositionsize and myequity arrays. Then, after
the loop, use SetPositionSize(mypositionsize, spsShares).
If above
works, I don't think that CBT would be necessary.
Just a thought, no
guarantees. --
Keith
.
__._,_.___
**** 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/
__,_._,___
|