Document version 0.27

Firebird … the fabled bird of Greek mythology 
endures as a symbol of immortality, consumed by fire to rise from the flames born anew.”



All screens shots are from a daily chart but the EA also works on other time frames.
The horizontal lines in the grid are 30 pips apart.
PipStep=30 and TakeProfit=30  Lots=1 is assumed in all examples.
All profit/losses are inclusive spread and exclusive slippage and rollover profits/losses.
Don't expect easy answers. We are playing a game with thousands of other cutthroats, erm traders, that play for keeps.
In it's current state Firebird is to bugged/untested /unsafe for trading real cash!



Picture 1
If you look from a distance at a lot of daily data, you see prices move in rather smooth waves.
If you look closer you see there sometimes are spikes. Those spikes usually are quickly corrected.
Firebird tries to catch those spikes. (white circles)
To determine what's a spike firebird first calculates a simple 10 bar moving average.
Then it shifts that average up and down a certain percentage to form bands. (envelope) 
All prices outside the envelope are considered spikes/entry points.
We can only guess what causes a spike. A few examples of things that may have impact are:
  1. Oil crisis
  2. Economic data released
  3. War, earthquakes, hurricanes etc.
  4. Mind games played by banks.
The reason is not important. The only thing that counts that the spikes are there.
Most of the time the spikes are short lived and retrace back into the channel within 1-5 bars.
But stock market crashes like the one after 9/11 can have very strong spike/trend that takes very long to correct.
You can ask yourself if the news should be monitored. Well my personal opinion is no. First of all I have a daytime job so Firebird has to trade
without any user intervention. Reading news is an art on itself. The spikes usually are caused by the market overreacting to something. 
Things like news. So avoiding news will give you less spikes to trade. Spikes that very often are short lived. "Crude oil price about to rise due to tension in the Gulf region". How much will that make prices move? I never have been able to find a useable relation between the news and the price action. 
Perhaps you avoid a nasty drawdown by reading the news but you will also miss out on many profitable trades that most likely cover that one loss.


Examples

Picture 2
When the price breaks the lower band, Firebird goes long. 
Then waits for the price to reverse and takes a 30 pips profit on the next bar.

Picture 3
In this example the trade goes against us. 
After going long in the yellow circle the price keeps dropping.
Every 30 pips the price drops Firebird buys another lot. 
The 4th lot is bought in the blue circle.
Profit is taken in the white circle.
--> The average buying price + 30 pips.
All 4 lots are sold at the same time. 
Some will make a loss and some will make a profit.
On average 4x30=120 pips profit is made.

Picture 4
The trade is entered at the yellow circle. 
As you see the price keeps going against us for several bars.
In the blue circle the last sell is added to our position.
The top red line is the average price of our trades.
The bottom red line is our Profit target. AveragePrice-30pips.
Then we have to wait until the red circle and we finally can grab some profits.

The above trade didn't go so well because we had to wait 14 bars to cash in.
$1200 in 14 bars isn't that bad if it doesn't happen often.
But what if the bar with the red circle and the one next to it didn't get low enough?
Then we would have a been in an up trend with 4 open short positions.
Soon Firebird will buy more positions on the way up. 8 in this picture.
That's 8x1000 for buying the lots plus a lot of margin.
The first position for example 8*30=240 pips against us.
The second position 7*30=210 pips. etc
That quickly adds up so a large sum of money! ($18800)
Especially if you are in bad luck and several pairs go against you.
That's the biggest problem of Firebird. But there are ways to minimize this risk.
You can configure Firebird to only enter x pairs at the time no matter how many charts it's running on.
This guarantees plenty signals but limits large positions.
Please note that trading 1 pair doesn't mean Firebird won't use more than 1 lot.
By design Firebird keeps averaging/adding lots until your account blows up.
The MaxLots setting allows you to define what the maximum number of lots is that Firebird trades.
If you stop Firebird from averaging you have to  wait longer until the trend reverses and Firebird starts cashing in.
Even if you stop averaging you keep loosing money if the trend goes against you. 
Just because in lots in your account keep loosing more and more.
FireHedge is the solution to this problem.


Picture 5
Lets look at a short position. (trend broke the upper band)
Firebird does its thing and buys at a loss of 0, 30 and 60 pips.
At 90-pips the, configurable FireHedge kicks in.
Firebird sells its last lot. Now the short position is 4 lots.
At the same time (90 pips) it also goes long with 4 lots.
Assume the trend goes another 1000 pips against us. (trend keeps going up)
Your 4 short lots suffer a 4x1000=4000 pip extra drawdown.
But your long lots gain 4x1000=4000 pip profit.
Now we just have to wait until the trend reverses and start making profit.
This can take a while in extreme cases but at least we still have our account.
And because we have the position hedged we don't even loose on rollover costs.
Account size needed to trade this method:
1+1 lots: $2300+  (0 pips)
2+2 lots: $4900+  (30 pips)
3+3 lots: $7800+  (60 pips)
4+4 lots: $11000+  (90 pips)
5+5 lots: $14500+  (120 pips)

Don't expect this to work with a 1 pip accuracy because we have to deal with things like spread and slippage.
We can't either open/close a position on exactly the 30-pip border for example.
The reason for this is that the price may keep bouncing up and down a few pips around that border. That would mean many opening/closing of the positions and that way loosing many pips in spread.

First of all I'm planning an option to let Firebird only take positions in one pair.
Even if you have the EA running on 10 pairs. This will reduce the profit to about $400/day.
You will be missing out on those lovely $900 days.
But when things go wrong they only go wrong on one pair. It's more likely your account can handle that.
I know it's very tempting to go for more profits. But losing $30k stands for 100x30 pips profit.....




Picture 6
In this example width of the envelope is wider. The trade enters in the yellow circle.
The horizontal red line is the entry point of the example above. (Picture 4)
Exactly the same chart. Just wider envelope. (higher percentage)
The entry point is about 30 pips higher. That's 30 pips less risk if the trend doesn't reverse quickly.
Compared to the above chart we could exit the trade 30 pips earlier.
That's not only safer but we could use a trailing stop to lock in that extra 30 pips.
Now look back at 'Picture 2'.
The envelope would have shifted down 30 pips at that place too. So we miss a trade there.
We need to find a balance between potential  profits and risk.
Very wide bands means less trades with very high probability. Plus more trailing stop potential.
Narrow bands means more trades with less probability and less chance with a trailing stop.
But if you take my suggestion of trading 5+ pairs but only take positions in 1 pair my guess is that you still get enough
signals to trade every day.
In the end it all depends on your nerves and trading capital. 
Safety above all. It's very easy to wipe out your account and loose 200 winning trades.


Settings
There are many, to many, settings in Firebird.
Most of them just are there for testing and development.
Some have a big impact some almost have almost no effect.

- MA_length
A moving average is calculated over a number or bars.
10 seems to be a good value. Playing with Percent gives often very similar result.
Play with it if you have lots of time. Else leave it at 10.

- MA_timeframe
Put the number of minutes here of the chart you are using.
10 for M10 charts. 1440 for D1 charts. etc
Just use the number that matches your chart unless you want to do some testing.

- MA_type
Type 0 calculates its bands using the current bars open.
Type 1 uses previous bars high for the upper band and previous bars low for the lower band.
Type 1 trades a little less that Type 0 but it's entries are usually closer to the reversal point.
So:
Type 0: More less certain trades.
Type 1: Little less trades that are more certain. With better potential for trailing stops.

- Percent:
A very important setting that has great impact on performance.
Small = many trades, many large positions, large drawdowns, larger account needed.
Large = less trades, fewer large positions, smaller drawdowns, smaller account needed, better trailing stop potential.

- Trade_on_Friday:
0 means don't trade on friday.
1 means trade on friday.
Friday is often seen as a day that gives unrealistic moves.
I backtested on it and it seems to make no diffrence for Firebird.
So use 1

- Slip
It's not always possible to get the exact price you want.
This setting allows Firebird to accept less perfect prices.
Don't set it to low because it can make you miss trades.
Usually you get what you want so I setting it small is of little use anyway.

- Lots
Enter the number of lots you want to trade each buy/sell.
This is not  the total number of lots Firebird will trade. Just how many lots it will trade per 30 pips that the price goes against it.
If this setting is at 1 Firebird will trade 3 lots if the price goes 90 pips against us.
If this setting is at 10 Firebird will trade 30 lots if the price goes 90 pips against us.

- TakeProfit
Firebird closes the position if this amount of pips is reached.
If set to high the target will not be met and the trade fails.
For EURUSD 30 seems a very nice value.
A lower value is more certain.
Often a lower value means lower risk and less drawdown.
Often. Not always....
Take a look at the 2nd picture.
It traded 4 lots (4x30=120 pips)
But with a setting of 20 pips it will trade 6 lots (6x20=120 pips)
Same amount of pips but $2000 extra to buy the lots.

- Stoploss
"Always limit your losses." That's a wise advise. But does it work with Firebird?
Take a look at the 2nd picture. Lets see how much this position went against us before it started to profit.
Position 1 was down 120 pips.
Position 2 was down 90 pips.
Position 3 was down 60 pips.
Position 4 was down 30 pips
----------------------------------------- +
Total down  300 pips

If you had set your stoploss at 100 pips the position would have stopped out and you would have lost 100 pips.
If the stoploss was 300+ pips you would have 4x30=120 pips profit.
The stoploss is for the total amount of pips in the EA on a certain chart.
If you run Firebird on 3 charts with a setting of 100 your risk is 300 pips

As a rough indication I can say that: (depends a lot on the pair and settings)
- 50% of the trades take 1 position. 
- 40% of the trades take 3 positions. 
- 9% of the trades take 6 positions. 
- 1% of the trades take 10+ positions.  
So i.m.o. you need to be able to hold at least 3-4 lots to seriously trade with Firebird.

Below a list of how many pips drawdown you get:
1 position: 30 pips
2 positions: 90 pips
3 positions: 180 pips
4 positions: 300 pips
5 positions: 450 pips
6 positions: 630 pips
7 positions: 840 pips
8 positions: 1080 pips
9 positions: 1350 pips
10 positions: 1650 pips

And that's excluding the $1000 it takes to buy 1 lot.
So if you want to trade 10 positions you need to set the stoploss at 1650+29=1679 pips.
That's $16790 drawdown plus $10000 for buying the lots. Total $26790 account needed.

Very often even the large drawdowns are corrected within 10 days.
Often not always. Allowing large drawdowns will make most trades profitable. But if that stoploss is exceeded it really hurts.
There is no answer to what stoploss is best.
I hope it's very clear to everyone  that the great track record of Firebird comes with a big danger!!!

PipStep:
When the position goes against Firebird it starts buying to average the position to a better value.
The value you enter here is how much the price must move to open a new position.
30 pips looks like a good value.
To low and Firebird will buy like crazy. To high and it is never able to average and starts loosing trades.

Increasment type:
When set at 0 it just uses the above mentioned PipStep.
When set at something else it gradually increase the size of PipStep.
The logic behind this is if Firebird needs to buy many lots the trend is strongly against us and will continue.
So we can buy a bit later. That way we get better averaging and less positions.
Number_of open_postions^Inceasment_type*PipStep =  pipstep_we_use_now

Assume we already have 2 open positions,  PipStep=30  and Increasement_type=2
2^2 *30=120 --> this pipstep grows much to fast to be useful.
Increasement_type=0.5
2^0.5 *30= 42 pips
Increasement_type=0.2
2^0.2 *30= 34 pips

This needs a lot of testing but i think the best values are between 0.2 and 0.5

MagicNumber
Only change this if you use Firebird more that once on the same  pair.
Just use a random number that you haven;t used yet.


Picture 7
This screen shot shows the difference between the 3 major PipStep methods.

The main conclusions are:
Decreasing PipStep
  1. The distance to retrace to break even gets better every lot  you add. Column G.
  2. Suffers the most draw down. Column H
  3. The better averaging (retracement) gives faster exits. So you buy more certainty with more lots/risk.

Fixed PipStep
  1. The distance to retrace to break even stays the same every lot  you add. Column G.
  2. Suffers the least draw down. Look at the number of pips when you compare not lot. 9 lots in this method covers as much pips as 11 in the others.

Increasing PipStep
  1. The distance to retrace to break even gets worse every lot  you add. Column G.
  2. Suffers average draw down. Column H
  3. The worst averaging (retracement) makes quick exits unlikely which leads to bigger positions.

And the winner is....
You decide!
But i.m.o. the third method is the looser.

Ideal settings

Mmmm, ideal.... Well I'm busy backtesting/optimizing to find the best settings for each pair/timeframe.
It's far from complete. Ideal settings means something different for everyone.
Small drawdowns with modest profit is what I searched for.


Using MA_Method=0

Percentage/DD in $k/number of days a trade is open/PipStep/TakeProfit   
10-25 means everything between 10 and 25


Pair
M15
M30
H1
H4
D1
USDCHF





GBPUSD





EURUSD
0.2, 3, 1, 20-25, 30
0.3, 4, 2, 20, 20
0.7, 4, 2, 35, 20
1.0, 5, 2, 30, 30
2.2, 5, 2  40, 30
USDJPY





AUDUSD





USDCAD
0.1, 2, 20, 20
-----
-----
1.3. 2, 5, 30, 30
1.8, 2, 30, 20
EURGBP

























Using MA_Method=1


Pair
M15
M30
H1
H4
D1
USDCHF
-----
-----



GBPUSD





EURUSD





USDJPY





AUDUSD





USDCAD































Some remarks/observations/thoughts
  1. GBPUSD not suited for this system due to not reversing exhaustions. Maybe use other types of MA.
  2. EURGBP often sharp reversals-> good for trailing stops?
  3. EURJPY deep pockets needed.
  4. Use fibo to calculate target/retracement starting from the max DD point.
ToDo list
  1. Finding the bug that stops averaging from working. (fixed?)
  2. Only takes short trades?????
  3. Stoploss (in progress)
  4. Trailing stop. Parabolic SAR and time limited? (in progress)
  5. EA interaction to stop trading multiple pairs at once.
  6. Lots of testing. (in progress)
  7. At the opening of the 1st position open lay in the orders for the next 10 also. Safer in case of a internet/power outage.
  8. ProfitTarget based on stats (in progress)
  9. Fix hold long and short positions at same time.
  10. Max. Lots. Stops adding lots. Risk is that averaging principle is abandoned.



Credits:
  1. Vooch for the backtesting fix.
  2. Hugues Du Bois for the multi currency code.
  3. Jackie Griffin for major debugging and code additions.
  4. Many people on the Yahoo MT forum  for testing and feedback


---[ TraderSeven ]---