Job finished
Specification
This bot will need to profitably trade breakouts and/or the retracements after breakouts. It is easiest to explain via the below chart.
Assume the red line is the support/resistance line which has been calculated using a configurable number of bars.
On launch, and at every, x number of new bars, a pending buy and sell orders are placed at the resistance levels. X is configurable in variables and defaults to 1, eg. at the start of every new hour. The pending orders will need to be adjustable by a variable number of pips either above or below the R/S level. And be placed with a configurable SL. Once the pending order is triggered, a close (configurable) stop loss will update the trade until it stops out at (hopefully) a profit.
Once the trade returns to the normal range, an optional retracement trade needs to be opened, which will have a loose (configurable) Trailing stop and configurable TP. The TP needs to be a percentage of the range between the top and bottom Support/Resistance levels. E.G. if i set the TP at 50%, that means the TP will be exactly half way between the support and resistance lines.
So as an example, refer to the image above. At 1 the pending order will be triggered, and presumably a failed trade will result as a breakout didnt occur.
At 2, an optional retracement trade is opened which will close with a small profit.
at 3, the true breakout occurs, and the bot makes a good profit.
at 4, another retracement trade is opened which will make a smallish profit.
The bot will need to be configurable so that i can enable either just the retracement trades, just the breakout trades, or both (or none - if i really wanted). The lot sizes will need to be configurable as a either a fixed size, or % risk and so Money Management needs to be included.