Hey Gang,
Promoting Trades To Higher Timeframes.
I've had this one stuck in my head for around a year now, and comes from 3 basic facts...
1. A range on a high timeframe is simply a series of trends on a lower timeframe.
2. A retrace on a higher timeframe is a trend on a lower timeframe.
3. A retrace on a lower timeframe is just a blip on a candle of a higher timeframe.
I guess that's why we use smaller stoplosses on lower timeframes, eh?
For most of the time I've been thinking about this, I thought it would be simple to do... Who'd have thunk that MegaDopes would have left out such a simple thing from Empty4 as the ability to change magic numbers or comments?!
Anyways...
Grab your most successful trend trading EA's for each timeframe... It could be a single EA that works on all timeframes, or a bunch of them...
Add the following to each...
1. User Inputs...
Delay: Default 500. Wait how long, (in milliseconds), before starting EA. Used to stagger-in each timeframe's EA, so that they have enough time to verify their control files, then import and export any trades that they had control of on a previous run of the EA. The higher the timeframe you put the EA on, the higher the delay, to give lower TF's EA's time to do their thing.
BaseLots: (Replaces any MoneyManagement or Lots input). Defaults to broker's MinLots setting.
ManageTradesOnly: Defaults to true. Hell, I might want to manage a trade on the weekly timeframe, but I sure don't want the DD from opening a trade on it.
ScaleIn: Defaults to false. Do you want to scale-in on winning trades?
JSLMultiplier (Needs a better name): Defaults to 2. How much profit do you want locked in, (calculated as JSLMultiplier * cash value of JumpingStop) before scaling-in, (& doubling up).
MaxSILevel: Defaults to 3. Minimum is 0. Used in BaseLots * MathPow(2, SILevel) to determine lotsize of scale-in trades.
PromoteTrades: Defaults to false. Ignores the following inputs, unless set to true.
ImportTrades: Defaults to false. Ignores the following inputs, unless set to true.
ImportMagic: Magic number of the EA you're importing from.
ImportTimeFrame: Timeframe of the EA you're importing from.
ImportMagic and ImportTimeFrame are combined with Symbol & Longs/Shorts to get part of import file name. e.g. Longs from E/U 1M to E/U 5M:- 12345_EURUSD_1_Longs_To_54321_EURUSD_5.csv
ExportTrades: Defaults to false. Ignores the following inputs, unless set to true.
ExportMagic: Magic number of the EA you're exporting to.
ExportTimeFrame: Timeframe of the EA you're exporting to.
ExportMagic and ExportTimeFrame are combined with Symbol to create part of export file name.
e.g. Shorts from E/U 5M to E/U 15M:- 54321_EURUSD_5_Shorts_To_67890_EURUSD_15.csv
================================================================
2. A management control file verification/reconstruction routine.
3. When the EA enters a trade, it should write the trade's details one of two management control files... MagicNumber_Symbol_Period_Longs.CSV, or MagicNumber_Symbol_Period_Shorts.CSV. The details required are TicketNumber, OpenPrice, Lots, StoplossPrice, EntryType (I for initial trade, S for scale-in trade) and JumpCount (0), (number of times your jumping stop has jumped after breakeven).
The reason for EntryType and JumpCount? I'll get to that in a moment
4. Only manage trades that are in the EA's control and import files. At each jump of stoploss after breakeven, modify StopLossPrice, and increment Jumpcount.
5. A trade import function. Cut trades' info from the previous EA's export file, (this EA's import file), and paste into this EA's management control file when the EA has entered a trade in the same direction, and it has hit BE or a higher JSL point- or - if ManageTradesOnly is true, when there is enough momentum in the same direction.
6. A test to see if you can afford to begin scaling in. (See Martinscaling, above). Ignored if ManageTradesOnly is true.
7. A test to see if there's enough momentum to make it worth scaling in. Ignored if step 5 fails, or ManageTradesOnly is true.
8. A trade export function. Export trades *after* scaling in. When exporting trades, change EntryType to P (promoted), and JumpCount to 0.
As you can see from the text file attached to the first post, once your initial trade's jumping stop has moved six times, the martinscaling effect is self-perpetuating, and so from the seventh jump onwards, you have to close the oldest trade, or you'll end up with your doubling effect eventually becoming a quadrupling effect, then octupling, etc, (which is fine if you have no limit to the number of lots in play at once... My broker limits me to five lots, though)...
So, after the sixth jump of the initial trade, (and after you've entered your fifth scale-in trade), you begin exporting the oldest trade each jump to the next timeframe up. Since an exported trade's stoploss doesn't move until it is imported by the EA on the next timeframe up, the oldest trade still adds its profit to cover the potential loss of the most recent scale-in trade.
On the new timeframe, after imported trades have their SL moved three times (after breakeven), they will have kickstarted the martinscale process enough that they, plus initial trade of that timeframe, can be exported to the next level.
Examples of management control filenames, & export/import filenames...
12345_EURUSD_1_Longs.csv
12345_EURUSD_1_Longs_To_54321_EURUSD_5.csv
54321_EURUSD_5_Longs.csv
54321_EURUSD_5_Shorts.csv
54321_EURUSD_5_Shorts_To_67890_EURUSD_15.csv
As to how to code any of this, all I can say is, "Women's magazine... No Idea" (It's an Aussie magazine, that has no idea, not women).
Have fun!
Radar =8^)