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

[amibroker] Re: subscript out of range



PureBytes Links

Trading Reference Links




Hello,
 
 
Use this:
 
NumOfContracts = ... your code determining number of contracts 
you want...
 
MarginDeposit = 2000;
PositionSize = NumOfContracts * MarginDeposit;
 
Hope this helps.
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=kk2628@xxxxxxxxxxxxxxxx 
  href="">kk2628 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, January 17, 2004 9:23 
  AM
  Subject: [amibroker] limiting position 
  size for futures
  
  Hi,
  
  SetOption(<FONT 
  color=#ff00ff>"InitialEquity", <FONT 
  face="Courier New" color=#ff00ff>8000<FONT 
  color=#000000> ); 
  PositionSize=-100;//This let me 
  invest all money I have and the contract size just does not make 
  sense.
  Margin deposit is 
  2000;
  What I want to achieve is 
  initially I just start with 2 contracts/trade and maximum contract/trade would 
  be 20 contracts if I make money, and the contract to be reduced to 2 
  contracts if there is a 6 consecutive losses (irregarless of value). I have 
  been trying to search all the mails and writeup in Amibroker but not able to 
  code this in AFL for backtesting, can someone please help 
  ?
  Thanks
  KK
   Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 
  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 
  
  
  Yahoo! Groups Links
  
    To visit your group on the web, go to:<A 
    href="">http://groups.yahoo.com/group/amibroker/  

    To unsubscribe from this group, send an email to:<A 
    href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx  

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


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








Yahoo! Groups Sponsor


  ADVERTISEMENT 









Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.