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 -----
From: Keith McCombs
To: [email protected]
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
Recent Activity
a.. 37New Members
b.. 1New Files
Visit Your Group
Give Back
Yahoo! for Good
Get inspired
by a good cause.
Y! Toolbar
Get it Free!
easy 1-click access
to your groups.
Yahoo! Groups
Start a group
in 3 easy steps.
Connect with others.
.