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

Re: [amibroker] Point value /position size and spreadbetting ... help please ...



PureBytes Links

Trading Reference Links




Andrew,
 
Go to HELP in AB and read the tutorial: " Back-testing 
systems for futures contracts "
 
Although you don't use contracts, you can bet (buy) more than 
one contract at a time to simulate different bet sizes and number of 
bets.
 
To enter a constant point value for individual 
securities, go to SYMBOL > INFORMATION and see the entry for <FONT 
color=#0000ff>point value (bet size). The gain or loss will be multiplied 
by that value.
 
To control point value within your formula so it can be easily 
changed, use a PointValue= line.
If you are betting 50 per point, try <FONT 
color=#0000ff>PointValue=50.
 
If you are doing one bet at PointValue=50, then buy one 
contract. Two contracts for two bets & etc.
 
Since you may not require any margin to place a bet, try 
MarginDeposit=1.
Then, if you want to place 1 bet at 
PointValue=50, use <FONT 
color=#0000ff>PositionSize=MarginDeposit.
To place 2 bets at PointValue=50, 
use PositionSize=2*MarginDeposit.
 
AB is wonderful at controlling positions and sizes. In the 
future TJ will include the ability to add to or liquidate <FONT 
color=#ff0000>existing positions. With the increasing popularity of 
single stock futures (not to mention those of us working commodities for years), 
TJ has wisely included some basic features for a growing segment of traders. I'm 
eager for more to come.
 
One final note:
In -
 
Stoptrigger=MA(c,8);
 
stop=abs(c-stoptrigger);
 
Be sure to keep track of the point value for each point of 
gain or loss. If you set your stop by a difference in points and then compare it 
to your risk (0.02*Equity), that won't be accurate if you lose 50 pounds for 
every point the chart falls by.
 
-CS
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Andrew 
  Smith 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, March 12, 2003 11:21 
  AM
  Subject: [amibroker] Point value 
  /position size and spreadbetting ... help please ...
  
  Hi. Im stuck. I wonder if anyone can 
  help...
   
  I've desgined a system that seems to work when I 
  back test it as if I were buying/selling equities.
   
  However, I intend to operate it in a UK 
  spreadbetting account. I dont know if this is available in the US, but 
  basically, you decide on a "bet size" and bet in the direction you think a 
  share/index/commodity will go. For example, lets say my system tells me to 
  sell Microsoft, I can "bet" £1 - £50 per point (cents, pence etc) move. So if 
  I bet £10 per point that MSFT will fall, and MSFT goes down 20 points, my 
  account is credited with £200 ... and vice versa. Very simple. 
   
  Now, Im stuck on how to program this in AB using 
  the position size, pointvalue and num contracts, etc. Can someone tell me if 
  my logic is correct?
   
  1) Im expetcing to be in positions for days/weeks 
  so I buy on close or open next day using a simple breakout system, so Im 
  always above (long) or below (short) a moving average. Lets say Im going 
  long and I decide the "points" I am prepared to lose will 
  be the difference between my entry and an 8 day moving average: 
  stop= abs(c - MA(C,8));
   
  2) I will be risking 2% of my current equity on 
  every operation: risk = round(0.02*Equity()); NOTE: Ive also tried setting 
  risk to a fixed value, 200, and it still doesnt give meaningful 
  results.
   
  3) As contracts per se dont exist, I set the 
  numcontracts to 1. Im not sure this is correct, but it seems logical as 
  bet size or pointvalue is variable. In futures you buy variable numbers of 
  contracts and have a fixed point value, in spreadbetting you decide your own 
  point value and dont "buy" any contracts at all. 
   
  4) The number of points to the stop must be less 
  than the £ risk for the position to be affordable: for example, if the stop is 
  40 points away, and my risk is calculated to be 200, my bet size will be 5. If 
  I am stopped out right away, I will lose 5*40 = 200. If the stop is 300 points 
  away, and my risk is 200, I cant enter that position (bet size<1 is not 
  allowed by the system)
   
  5) Pointsvalue will be: 
  pointvalue=round(risk/stop);
   
  6) I have absolutely NO idea how to use 
  positionsize in this set up ... Do I need it? Should I set 
  positionsize=-2?
   
  7) Futures mode is ON when I back 
  test.
   
  8) I have also no idea how to set margindeposit, 
  cos there isnt any "deposit" made, so I havent included it in the 
  coding..
   
  Here is my final code:
   
  Stoptrigger=MA(c,8);
   
  Numcontracts=1;
  E=Equity(1,-1);
   
  stop=abs(c-stoptrigger);
  risk=0.02*E;
   
  buy=rule1 AND risk>stop;
  short=rule2 AND risk>stop;
  cover=rule3;
  sell=rule4;
   
  pointvalue=round(risk/stop);
   
  This gives me exponential negative numbers in the 
  backtest (and low positive numbers in the simple equity back test) ... so I 
  think Im doing something wrong ... what coding have I missed out to be able to 
  run the backtester OK?
   
  Any ideas anyone?
   
  Thanks ...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 
  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.