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

Re: [amibroker] is this the right setup for fx contracts



PureBytes Links

Trading Reference Links

Hello,

Apparently either PointSize or MarginDeposit are set wrong
or not set at all.
See the tutorial:

Margin deposit

The margin is the amount of money required to open single contract position. You can specify per-symbol margin in the
Symbol-Information page (picture above). Positive values describe margin value in dollars, while negative express margin value as
percentage of contract price. Magin value of zero is used for stocks (no margin). Margin can be also specified in the formula by
using MarginDeposit reserved variable:

  MarginDeposit = 675;

In the Futures mode margin setting is used to determine how many contacts can be purchased. Let's suppose that your initial equity
is set to $50000 and you want to invest upto 20% of equity in single trade and the margin deposit is $675. In that case your
"desired" position size is 50'000 * 0.2 = 10'000. Provided that you have set round lot size to 1, the backtester will "buy"
10000/675 = (integer)14.8148 = 14 contracts, and true positon value will be $9450 (18.9% of the initial equity).

To simulate this in AmiBroker you would need to enter 50000 in the Initial Equity field in the backtester, switch on futures mode,
and setup remaining parameters in your formula:

  PositionSize = -20; // use 20% of equity
  MarginDeposit = 675; // this you can set also in the Symbol-Information page
  RoundLotSize = 1; // this you can set also in the Settings page

All further trades will use the same logic but position will be sized according to current cumulated equity instead of initial
equity level, unless you specify fixed position size in your formula ( PositionSize = 10000 for example).

Point value


Point-value is per-symbol setting (definable in Symbol-Information window - (picture above)) that determines the amount of profit
generated by one contract for a one point increase in price. Example: copper is quoted in cents per pound, a price quote of 84.65
(or 8465) equals 84 cents and 65/100 of a cent per pound. A change of +.37 or 37 represents 37/100ths of a cent you will normally
hear it quoted as 37 points. But because of the fact that point value for copper is 2.5 every point change gives $2.5 profit/loss,
so in this example profit/loss for the day would be 2.5 * 37 = $92.50.

You can also set it from the formula level using PointValue reserved variable, for example:

  PointValue = 2.5;

Note: When you load old database AmiBroker presets point value field to 1 and assumes that by default 1 point represents one dollar
so one dollar change gives one dollar profit/loss. This is done to ensure that you get correct results even if you (by mistake) run
futures mode test on stocks.

Note 2: Although point value setting affects (multiplies) profits/losses it does NOT affect built-in stops. The stops ALWAYS operate
on price movement alone. So you should be aware that setting 10% profit target stop will result in 25% profit on trade exited by
this stop when point value is set to 2.5.



Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "adam_fx" <adamjrainer@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, June 09, 2003 4:50 AM
Subject: [amibroker] is this the right setup for fx contracts


> Is this the right setup fo fx contracts? ...what am i doing wrong as
> anual return is only .05% for nearly every system I try? Once i get
> the settings right I will at least be on the rihgt track.
>
> Settings
>
> Initial Equity: 10000  Periodicity/Positions: Daily/Long Short
> Commissions: 0.00 per trade  Annual interest rate: 0.00%
> Range: All quotations  Apply to: Current Symbol
> Margin requirement: 100  Futures mode: Yes
> Def. round lot size: 100  Def. Tick Size 0.0001
> Drawdowns based on: High/Low prices
> Long trades
> Buy price: Close  Sell price: Close
> Buy delay: 0  Sell delay: 0
> Short trades
> Short price: Close  Cover price: Close
> Short delay: 0  Cover delay: 0
> Stops
> Maximum loss: disabled  Profit target: disabled
> Value: 0.00  Value: 0.00
> Exit at stop? no  Exit at stop? no
>
> Trailing stop: point
> Value: 40.00
> Exit at stop? yes
>
> Formula
>
>
> // long trades entry and exit rules:
> Buy = EMA(Close,7)>EMA(Close,21);
> Sell = EMA(Close,7)<EMA(Close,21);
>
> // short trades entry and exit rules:
> Short = EMA(Close,7)<EMA(Close,21);
> Cover = EMA(Close,7)>EMA(Close,21);
>
>
> Overall performance summary
>
> Total net profit: 10.00   Total commissions paid: 0.00
> Return on account: 0.10 %    Open position gain/loss 10.21
> Buy&Hold profit: 32.03   Bars (avg. days) in test: 588 (731)
> Buy&Hold % return: 0.32%   System to Buy&Hold index: -68.77%
>
> Annual system % return: 0.05%   Annual B&H % return: 0.16%
>
> System drawdown: -8.42   B&H drawdown: -2.65
> Max. system drawdown: -13.39   B&H max. drawdown: -7.97
> Max. system % drawdown: -0.13%   B&H max. % drawdown: -0.07%
> Max. trade drawdown: -4.43
> Max. trade % drawdown: -0.04%
> Trade drawdown: -3.40
>
> Total number of trades: 26   Percent profitable: 23.1%
> Number winning trades: 6   Number losing trades: 20
> Profit of winners: 23.02   Loss of losers: -23.22
> Total # of bars in winners: 323   Total # of bars in losers: 231
> Commissions paid in winners: 0.00   Commissions paid in losers: 0.00
>
> Largest winning trade: 9.77   Largest losing trade: -2.78
> # of bars in largest winner: 89   # bars in largest loser: 7
> Commission paid in largest winner: 0.00   Commission paid in largest
> loser: 0.00
>
> Average winning trade: 3.84   Average losing trade: -1.16
> Avg. # of bars in winners: 53.8   Avg. # bars in losers: 11.6
> Avg. commission paid in winner: 0.00   Avg. commission paid in
> loser: 0.00
> Max consec. winners: 1   Max consec. losers: 7
>
> Bars out of the market: 21   Interest earned: 0.00
>
> Exposure: 96.4%   Risk adjusted ann. return: 0.05%
> Ratio avg win/avg loss: 3.30   Avg. trade (win & loss): -0.01
> Profit factor: 0.99
>
>
> Performance for EURUSD
>
> Total net profit: 10.00   Total commissions paid: 0.00
> Return on account: 0.10 %    Open position gain/loss 10.21
> Buy&Hold profit: 32.03   Bars (days) in test: 588 (731)
> Buy&Hold % return: 0.32%   System to Buy&Hold index: -68.77%
>
> Annual system % return: 0.05%   Annual B&H % return: 0.16%
>
> System drawdown: -8.42   B&H drawdown: -2.65
> Max. system drawdown: -13.39   B&H max. drawdown: -7.97
> Max. system % drawdown: -0.13%   B&H max. % drawdown: -0.07%
> Max. trade drawdown: -4.43
> Max. trade % drawdown: -0.04%
> Trade drawdown: -3.40
>
> Total number of trades: 26   Percent profitable: 23.1%
> Number winning trades: 6   Number losing trades: 20
> Profit of winners: 23.02   Loss of losers: -23.22
> Total # of bars in winners: 323   Total # of bars in losers: 231
> Commissions paid in winners: 0.00   Commissions paid in losers: 0.00
>
> Largest winning trade: 9.77   Largest losing trade: -2.78
> # of bars in largest winner: 89   # bars in largest loser: 7
> Commission paid in largest winner: 0.00   Commission paid in largest
> loser: 0.00
>
> Average winning trade: 3.84   Average losing trade: -1.16
> Avg. # of bars in winners: 53.8   Avg. # bars in losers: 11.6
> Avg. commission paid in winner: 0.00   Avg. commission paid in
> loser: 0.00
> Max consec. winners: 1   Max consec. losers: 7
>
> Bars out of the market: 21   Interest earned: 0.00
>
> Exposure: 96.4%   Risk adjusted ann. return: 0.05%
> Ratio avg win/avg loss: 3.30   Avg. trade (win & loss): -0.01
> Profit factor: 0.99
>
>
>
> Trade list for EURUSD
> Trade Entry date Exit date Net Profit Equity value
> Out 26/05/2001 1:30:00 AM 17/06/2001 8:30:00 PM 0.00 10000.00
> Long 17/06/2001 8:30:00 PM 29/06/2001 11:30:00 PM -1.23 9998.77
> Short 29/06/2001 11:30:00 PM 12/07/2001 11:30:00 PM -0.44 9998.33
> Long 12/07/2001 11:30:00 PM 5/09/2001 11:30:00 PM 3.20 10001.53
> ......
>
>
>
> 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 http://docs.yahoo.com/info/terms/
>
>
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/