Page 1 of 1

Help with ATR position sizing

Posted: Fri May 22, 2009 12:18 pm
by Matthader
I want to trade Forex with the Dual Crossover with no SL. Under the TradingBlox they use 1% per trade I believe based on some calculation of ATR. Can anyone who understands how they come up with this figure please give an example?

Is it as simple as taking 1% of your bankroll and then dividing that amount by the 15 day ATR? Then buying that many lots?

Posted: Fri May 22, 2009 3:39 pm
by kingami
ATR based position sizing assumes that you use stop loss which is away from your entry price in the distance of a number (normally 2 to 5) of 15 day ATR average. Divide 1% of your equity by that distance to get the number of lots you would trade.

If you don't use stop loss, you may need to based on the average loss in historical testing for your position sizing.

Posted: Sat May 23, 2009 11:50 am
by Matthader
Yes I'd like to use the method utilized in the backtest for Forex in Trading Blox Dual Crossover system. Does anyone know the calculation they used?

Posted: Sat May 23, 2009 6:17 pm
by sluggo
Here's the actual software code used by the Dual Moving Average system that comes with Blox (top image). Important quantities are encircled in different colors.

The definitions of these quantities (using the same color code) are shown in the bottom image.

Posted: Sat May 23, 2009 9:05 pm
by Matthader
Within the Blox users guide it says that it uses a theoretical stop of 1 ATR for position sizing when you elect not to use stop loss.

But when I go through the trades I still can't seem to make since of it. Are they using a 39 day ATR or 15 day? Lets say it was 65 pips. What steps do I need to follow from there for Forex?

I apologize for asking such a newbie question.

Posted: Sun May 24, 2009 10:40 am
by sluggo
You seem to be asking two different questions: (Q1) Where does "1 ATR" appear in the positionsizing calculations; (Q2) How many bars of price data are used to calculate the ATR?

The answers are: (Q1) In lines 7-11 of the code shown above; (Q2) The human user (who is running Blox software) specifies the #bars, circled in blue above.

Please note that the example above is running on a portfolio of 6 Forex instruments, taking "All" trades (Longs and Shorts) that the system signals.

Posted: Sun May 24, 2009 11:26 am
by Matthader
Ok I see that when I change the amount of days from 39 to 15 and run them that the trade posiiton sizes do change. I just don't understand what the system does after it has the ATR to come up with how many lots to trade.

Posted: Sun May 24, 2009 2:35 pm
by Tim Arnold
The Fixed Fractional Money Manager uses the amount of equity to risk divided by the trade risk as the number of contracts or shares to trade.

So take the percent risk (risk per trade times the equity) and divide by the risk of the trade ( in this case one atr times the dollars per point ) and that will give you the quantity to trade.

For forex, the dollars per point is based on the "forex trade size" as defined in the global parameters. So for an excel audit, determine the dollars profit per pip based on the trade size of your broker and as defined in the global parameters, multiply by the atr in pips, and that is your denominator.

Note also that we use an exponential moving average for the ATR, so a 39 in this case is equivalent to a 20 "day" Wilder atr. See the manual for a more complete explanation.

Posted: Sun May 24, 2009 5:25 pm
by Matthader
Thanks so much everyone for taking the time to help me out. I was mistakenly multiplying the entry price, and for FX it should not matter. Cool.

Posted: Thu Oct 01, 2009 10:24 pm
by benavju
Hi I am new at using Trading Blox, I am testing a DMA System with Forex (Majors Only). I run a simulation and I want to know where I can find the actual ATR and the Dolar point value for every trade. I am trying to understand the positon sizing for every trade :?:
Thanks in advance for the help.

Posted: Sat Oct 03, 2009 11:05 am
by matthew28
Hello,
If you go to the File menu and look under Results and then Trade Log you will find the details of each trade. The DPP columns are Dollars Per Point. The TB User's Guide will give you more information in the section related to Log Files.
For a list of ATR values, assuming you have the Builder version of TB you could write the code:

PRINT instrument.date, instrument.symbol, instrument.averageTrueRange

in the After Instrument Day script for end of day data where the ATR indicator is called 'averageTrueRange.

Or

PRINT instrument.date, instrument.time, instrument.symbol, instrument.averageTrueRange

in the Update Indicators script for intraday data.
After the test go to the File menu again under Results but this time select Print Output and Excel will open with a spreadsheet showing the results, as below.

Posted: Sat Oct 03, 2009 11:12 am
by Tim Arnold
With the Pro Edition, you can use the Plot ATR block from the blox marketplace, to plot the atr and see the values for each day.

viewtopic.php?t=4725