The Follow Last Candle EA was made as a reaction to Robinho's "Follow the monthly candle and be profitable"-Thread.
When I first heard about this trading strategy, I doubted about it's efficiency. But because of it's simple ruleset, I decided to make an EA to backtest it.
Although I saw pretty promising backtest results, testing it forward showed me quite different results.
However, if you're up to try a similar strategy, here is what you can do with this EA:
- Open pending Orders in direction of the last Candle (Follow last Candle)
- Follow the last Candle, but only if the candle-body is big enough (e.g. bigger than 70% of whole candle size)
- Follow the last Candle, but only if last Candle in a bigger Timeframe went into the same direction
- Follow the last Candle, but only if last Candle in a bigger Timeframe went into same direction AND had a big enough candle-body as well
- Setting pending Orders into both directions (e.g. above and below the last candle)
- Setting pending Orders only at a specific day/time (e.g. only on Thuesday between 1AM and 7AM)
- Money Management settings (Fixed Lot size or maximum percentage of risk)
Settings
TRADE OPTIONS
TradeComment
This will be added to every Trade placed by the EA. It will be visible in the Trading History.
TradingFrequency
Your trading Timeframe. Trades will be placed according to this Timeframe.
Possible Settings are: Daily, Weekly, Monthly
BiggerTimeframe
The bigger Timeframe you refer to if necesary.
For Example: If you want to follow the daily candle, but only if the monthly Candle has the same direction, then you have to set the Options like this:
TradingFrequency = Daily
BiggerTimeframe = Monthly
TradingStyle = "follow last Candle if bigger Timeframe has same direction"
Possible Settings are: Daily, Weekly, Monthly
ReferencePrice
Here you can choose what exact price you refer to when placing a new pending order.
Possible Settings are:
- Last Candle's Close
- Current Candle's Open
- Current Price (Bid=Short, Ask=Long)
- Last Candle's High and Low
- Current Candle's High and Low
TradingStyle
Possible Settings are:
- follow Last Candle
Sets a pending Order in the direction of the last candle. - follow last bigger Timeframe
Sets a pending Order in the direction of the last candle in the bigger Timeframe.
For example: BiggerTimeframe = Monthly, TradingFrequency = Daily. If the last Monthly candle was Long, now you get a new pending Long Order every day. - follow last Candle if bigger Timeframe has same direction
Sets a pending Order in the direction of the last candle, but only if it's in the same direction like the last candle of the bigger Timeframe. - Place Short and Long, trade first hit only (Not Implemented!)
I didn't had the time to finish this Option. - Place Short and Long, trade both
This Option places pending Orders in both directions.
Adjust Price if necesary with
Sometimes it's not possible to open a pending Order due to Gaps. Here you can define if it should adjust the reference Price in such a case.
Possible Settings:
- Don't adjust Price
- Current Candle's Open
- Current Price (Bid=Short, Ask=Long)
- Current Candle's High and Low
Format of SL, TP and PointsAway
It's necesary to know the amount of digits after the comma of the price. But the EA should recognise it automatically. However, if you experience that your TP and SL are far away from what they should be, then it might be necesary to adjust this option manually.
"TP", "SL" and "PointAway"
Take Profit (TP) and Stop Loss (SL) should be clear.
"PointAway" defines how many Points away from the reference Price new pending Orders will be placed.
For Example: A Long-Trade with ReferencePrice "Last Candles High Low" and a PointAway of 10 will place the pending order 10 points above last Candle's High. This could avoid that your Order is activated by just one Pip.
MinCandleBodyPercent and MinBiggerTFBodyPercent
Here you can define a minimum % for the last Candle's Body Size. Like this you can avoid getting trapped by candles with no clear direction.
Expiracy in Minutes for pending Orders
If you want pending Orders not to exist forever, here you can set an amount of Minutes to remove them if they didn't got activatet until then.
WaitForNextCandleToPlaceTrade
This option causes the EA to wait with opening Orders until a new Candle starts on the Trading Timeframe. The default Value is set to "True" and causes the EA not to directly place an order right after activating the EA. It's an important option for live accounts and it's meant to have this behaviour!
So, if you want the EA to place Orders right when you activate it, then you have to set this Option to "False"!!!
MONEY MANAGEMENT
UseFixedOrderSize
Use "True" if you want to have a fixed Order Size.
Use "False" if you want to use a dynamic Lot Size calculated by the EA (according to your account Equity).
FixedOrderSize
If you use a fixed lot size, you can set the lot size here.
PercentOrderSize
If you use dynamic Lot Size, here you can set a percentage of the Account Equity to use for your SL.
MinOrderSize and MaxOrderSize
Manually set the minimum and the maximum Lot Size. It only applies if you set the next option to "False".
GetMinMaxLotsFromBroker
If "True", the EA will get the minimum and maximum Lot Size for the current Chart from the Broker.
RoundLotSize
If you use dynamic Lot Size, here you can choose whether you'd prefer to round the calculated Lot Size up or down.
Why? Because you can't trade a 0.018472 Lot and the EA has to decide if it takes 0.01 or 0.02. This can make a big difference.
Possible Settings: RoundUp, RoundDown, RoundUpOrDown
EA SETTINGS
ExecuteEAOn
Defines if the EA is getting executed on every Tick or in at regular interval.
Possible Options: Tick, Timer
TimerInSeconds
Here you set the interval in seconds if you want to execute the EA on "Timer".
MagicNumberOffset
The EA has a really ugly way of recognising Short and Long Trades; It just gives them Magic Numbers of 100 and 1000. If this interferes with another EA you have, you can change the Magic Numbers by adding the MagicNumberOffset to them.
ReplaceOrder
You most probably want to have this Option turned off. If it's turned on it won't place a new pending order if there's already an active pending order.
MaxSlippage
Sets the maximum of Slippage allowed. Be aware that this function may not work if your Broker does not support it (i.E. Brokers default method is Market execution)
SupportECNBrokers
If set to "True" SL and TP will be set separately after placing the order to support ECN brokers.
MARKET HOURS
UseManualMarketHours
Set it to "True" if you want to use manual trading hours.
Important: The Format must be exactly "00:00-00:00", or the EA will exit on startup with an error message.
DEBUG MESSAGES
Debug Messages are helping to understand what the EA was doing if something didn't get executed as expected. You can see them in the "Experts"-Tab of the Terminal.
I strongly recommand not to turn on PrintStillAliveMessage if the EA is getting executed on every Tick. It would try to write a Message on every Tick and could slow down your computer significantly.
BTW: The whole EA is based on another EA with really old legacy code, which was pretty annoying to work with.
I plan to make a new EA from scatch with a maintainable codebase in the next months. But I can't promise it for sure because my life is full of uncertainty.
And also I'm just aware of one unimportant bug in the latest version, USE AT YOUR OWN RISK AND IN DEMO ONLY, I reject any responsability for what you are doing with it!