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

RE: [amibroker] Contracts and position value



PureBytes Links

Trading Reference Links










What is your initial capital size, maybe you are using this
up in the first trade.

 



<font size=3 color=teal
face="Times New Roman">Cheers,
Graham

<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/ASXShareTrading

<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/FMSAustralia



<span
>-----Original Message-----
From: Andrew Smith
[mailto:andy_kovacs@xxxxxxxxxxx] 
Sent: Tuesday, 20 May 2003 8:32 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Contracts and
position value

<font size=2
face="Times New Roman"> 



<span
>Hi - I was wondering if anyone could
explain this to me:





<font size=2
face="Times New Roman"> 





<span
>Im using the following code





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">stop=<span
>IIf(Buy,stoplong,<span
>IIf(Short,stopshort,<span
>0)); // stoplong and stopshort are values
calculated by a trailing stop jscrip I found on the site





<span
>PointValue
= 1;

<span
>RoundLotSize=<font
color=purple>1;

<span
>risk=100; //fixed value in $ per position

<span
>NumContracts = <span
>IIf(risk/stop><span
>1,round(risk/stop),<font
color=purple>0);

<span
>MarginDeposit=<font
color=purple>1;

<span
>PositionSize
= NumContracts * MarginDeposit;

<span
>Now, my problem is the following. When I run an
explore, numcontracts works fine and I get the numbers Im expecting. However,
when I backtest, I get exponential results. Fr the first position of any
instrument I get 1e006, the rest are zero. Position value comes out at 0.

How are contracts and position value calculated? If I
know this I can amend my code ...

Thanks

Andy



<font size=2
face="Times New Roman">



Send
BUG REPORTS to bugs@xxxxxxxxxxxxx<span
>
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx 
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html


Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.











Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.