DFC 3stage trading helper EA's

The forum for Captain Jack and CJ related thingies.
Post Reply
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

DFC 3stage trading helper EA's

Post by SteveHopwood »

I came across the DIAD EA a couple of weeks ago, courtesy of a link sent to me by a member here.

DIAD stands for Double In A Day and is inspired by an impressive looking trading manager to be found at https://www.doubleinadayforex.com/. There is an explanatory youtube video at https://www.youtube.com/watch?v=1iul8paae-M.

The commercial DIAD dos a lot of fancy stuff with lot sizing, profit targeting and risk. It looks like a top piece of kit that could be invaluable to those of us trading manually. I had a look at pricing by clicking a 'Buy' button yesterday and it appears the price is $229 but that may be wrong. I asked the coder for a copy to test out in advance of negotiating a discount for SHF members and am testing it out. I will let you all know if it proves useful.

The idea it gave me here are much more simple. Inside the attached zipfile you will find 6 'helper' EA's. Their titles should make their purpose obvious, but play around on demo first to get a feel for what they do.

They are not auto-traders. They are 'helpers' that you apply to the chart once you have decided to take a trade. I have taken to setting a pending order when the market forms a new peak high or low, just beyond the top/bottom sixth of the chart. I simply move the stop order if the price continues to move in the 'wrong' direction and forms a new peak. The idea is to catch the eventual and inevitable escape from the sixth area.

I set a take profit of 100 pips. DIAD gave me the idea of taking extra trades on the way up, moving the stop loss to breakeven plus a few pips to pay for commission etc at each stage. I coded this as a module for HGBnDnSSnFB and it has proven to be a powerful pips harvester; I have adapted it for use here.

As an example of use, imagine that a pair has entered the bottom sixth, so I am going to set a buy stop order just above the sixth area. I want to take a second trade at +30 and a third at +60. I apply the buy stop helper ea and it:
  • sends the buy stop order then:
    • draws a buy stop line at the order open price + Trade2AtPips (+30) and a breakeven line in between the open market trade and the buy stop line.
    • draws a buy stop line at at the order open price + Trade3AtPips (+60) above the market trade open price, then a breakeven line in between the two buy stop lines.
    • draws a take profit line 100 pips above the price of the open market trade.
  • now imagine that the market rises and leaves the bottom sixth area, triggering the pending trade:
    • the market continues to rise and reaches the second trade line. The helper EA sends a second buy trade, then moves the stop loss of both open trades to the price of the second breakeven line. The DiadBreakevenProfitPips input allows you to specify a few extra pips to try to pay swap/commission costs. The position is now risk free, because a retrace to the stop loss will result in the profit on the first trade paying the loss on the second trade.
    • if the market continues to move upwards and reaches the third trade line, the helper sends a third buy trade and moves the stop losses of all three trades to the price of the second breakeven point. Should the market reverse and reach the stop losses, trade 2 pays for trade 3 and Trade 1 is the overall profit.
    • The take profit of each new trade is set to the price of the take profit line.
    • There is no need to divide your normal lot size by three. The only trade that will be exposed to the danger of loss is the initial trade.
Once the helper has sent the first buy stop order, I move it down if the market continues to form new peak lows. I drag the price line on the chart down and the take profit follows - one of the few thingies the cretins at crapperquotes have gotten right, so expect this feature to disappear soon. :arrrg: The lines the helper has drawn will move in tandem with the new stop order price, at the next tick.

The helpers delete the lines once each stage is completed, so there is no chance of trade repetition.

The helpers check that lines are in place and correct at every tick, and replaces them if they become deleted accidentally. The only difference in the code of each individual helper is the type of trade it is ordered to send. They can assume ownership of any existing trade with the same magic number (0 for manual trades) so long as they match the direction of the existing trade. Apply a sell helper to an existing buy trade and you will get chaos, so don't do it.

The second trade line is coloured turquoise by default, and the third is magenta; you have the options in the inputs to set your own colours. Buy lines are dashed and sell lines dotted. You do not have the option to change these and must not do so manually; the helpers are told which direction to trade by the line style. The first breakeven line is blue dash-dot and the second is salmon dash-dot. Here is what a buy stop chart will look like. The take profit line is the solid yellow one.

Here is an example of a buy stop chart, so you can see how yours should look. The arrow shows where the helper placed the the trade 50 pips above the market. You can see how I dragged the stop order down and the lines followed:
Buy stop example.png
A sell stop chart will look like this, again with the first stop order dragged to a new position:
Sell stop example.png
The helpers are only allowed to send the second trade if there is already a market order in place, and the third if there are already two open market orders. Do not close any of them manually without removing the helper first.

The helpers' job is done once the third trade is open and all three stops have been moved to the second breakeven price. They remove themselves from the chart and sound an alert to inform you. You can disable the alert by setting ShowRemovalMessage to 'false' - find it at the bottom of "General inputs".

Trade2AtPips is the distance from the initial order price to draw the second trade line. Trade3AtPips is the distance from the initial order price to draw the third trade line.

I coded these helpers with my DFC trading in mind. They can be applied to any manual trading where you think they will boost your profits.

--------------------------
Coders, the code in all the helpers is identical; I wrote the code so that all that needs changing is the value of the TradeType variable at line 36. If you add your own chunks of code, here is the easiest way to produce the next 5 variants:
  • add and debug your code to one of the helpers.
  • change the value of TradeType to reflect the OrderType() you wish to send.
  • do a /File/Save As with a filename that reflects the OrderType().
You can easily create one helper to allow all OrderType() to be sent from the single helper by making line 36 and extern input. I created 6 individual ones because I hate faffing around with inputs.
-----------------------

It remains to be seen how useful all this will turn out to be. Play with the helpers and see.

:xm:
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
saintalan
Trader
Posts: 46
Joined: Fri Nov 30, 2012 1:30 pm
Location: Windsor, UK

DFC 3stage trading helper EA's

Post by saintalan »

Thanks Steve, does your mind never stop? It's hard keeping up :)

There are several videos on the site which give a general idea so it will be interesting to see how this goes.

Cheers

Alan
Gogetta247
Posts: 5
Joined: Sun Apr 23, 2017 10:36 am

DFC 3stage trading helper EA's

Post by Gogetta247 »

Thank you very much for sharing..Will start demo testing when market opens next week and share results..Cheers
SteveHopwood » Sat May 06, 2017 1:20 pm wrote:I came across the DIAD EA a couple of weeks ago, courtesy of a link sent to me by a member here.

[hide]DIAD stands for Double In A Day and is inspired by an impressive looking trading manager to be found at https://www.doubleinadayforex.com/. There is an explanatory youtube video at https://www.youtube.com/watch?v=1iul8paae-M.

The commercial DIAD dos a lot of fancy stuff with lot sizing, profit targeting and risk. It looks like a top piece of kit that could be invaluable to those of us trading manually. I had a look at pricing by clicking a 'Buy' button yesterday and it appears the price is $229 but that may be wrong. I asked the coder for a copy to test out in advance of negotiating a discount for SHF members and am testing it out. I will let you all know if it proves useful.

The idea it gave me here are much more simple. Inside the attached zipfile you will find 6 'helper' EA's. Their titles should make their purpose obvious, but play around on demo first to get a feel for what they do.

They are not auto-traders. They are 'helpers' that you apply to the chart once you have decided to take a trade. I have taken to setting a pending order when the market forms a new peak high or low, just beyond the top/bottom sixth of the chart. I simply move the stop order if the price continues to move in the 'wrong' direction and forms a new peak. The idea is to catch the eventual and inevitable escape from the sixth area.

I set a take profit of 100 pips. DIAD gave me the idea of taking extra trades on the way up, moving the stop loss to breakeven plus a few pips to pay for commission etc at each stage. I coded this as a module for HGBnDnSSnFB and it has proven to be a powerful pips harvester; I have adapted it for use here.

As an example of use, imagine that a pair has entered the bottom sixth, so I am going to set a buy stop order just above the sixth area. I want to take a second trade at +30 and a third at +60. I apply the buy stop helper ea and it:
  • sends the buy stop order then:
    • draws a buy stop line at the order open price + Trade2AtPips (+30) and a breakeven line in between the open market trade and the buy stop line.
    • draws a buy stop line at at the order open price + Trade3AtPips (+60) above the market trade open price, then a breakeven line in between the two buy stop lines.
    • draws a take profit line 100 pips above the price of the open market trade.
  • now imagine that the market rises and leaves the bottom sixth area, triggering the pending trade:
    • the market continues to rise and reaches the second trade line. The helper EA sends a second buy trade, then moves the stop loss of both open trades to the price of the second breakeven line. The DiadBreakevenProfitPips input allows you to specify a few extra pips to try to pay swap/commission costs. The position is now risk free, because a retrace to the stop loss will result in the profit on the first trade paying the loss on the second trade.
    • if the market continues to move upwards and reaches the third trade line, the helper sends a third buy trade and moves the stop losses of all three trades to the price of the second breakeven point. Should the market reverse and reach the stop losses, trade 2 pays for trade 3 and Trade 1 is the overall profit.
    • The take profit of each new trade is set to the price of the take profit line.
    • There is no need to divide your normal lot size by three. The only trade that will be exposed to the danger of loss is the initial trade.
Once the helper has sent the first buy stop order, I move it down if the market continues to form new peak lows. I drag the price line on the chart down and the take profit follows - one of the few thingies the cretins at crapperquotes have gotten right, so expect this feature to disappear soon. :arrrg: The lines the helper has drawn will move in tandem with the new stop order price, at the next tick.

The helpers delete the lines once each stage is completed, so there is no chance of trade repetition.

The helpers check that lines are in place and correct at every tick, and replaces them if they become deleted accidentally. The only difference in the code of each individual helper is the type of trade it is ordered to send. They can assume ownership of any existing trade with the same magic number (0 for manual trades) so long as they match the direction of the existing trade. Apply a sell helper to an existing buy trade and you will get chaos, so don't do it.

The second trade line is coloured turquoise by default, and the third is magenta; you have the options in the inputs to set your own colours. Buy lines are dashed and sell lines dotted. You do not have the option to change these and must not do so manually; the helpers are told which direction to trade by the line style. The first breakeven line is blue dash-dot and the second is salmon dash-dot. Here is what a buy stop chart will look like. The take profit line is the solid yellow one.

Here is an example of a buy stop chart, so you can see how yours should look. The arrow shows where the helper placed the the trade 50 pips above the market. You can see how I dragged the stop order down and the lines followed:


A sell stop chart will look like this, again with the first stop order dragged to a new position:


The helpers are only allowed to send the second trade if there is already a market order in place, and the third if there are already two open market orders. Do not close any of them manually without removing the helper first.

The helpers' job is done once the third trade is open and all three stops have been moved to the second breakeven price. They remove themselves from the chart and sound an alert to inform you. You can disable the alert by setting ShowRemovalMessage to 'false' - find it at the bottom of "General inputs".

Trade2AtPips is the distance from the initial order price to draw the second trade line. Trade3AtPips is the distance from the initial order price to draw the third trade line.

I coded these helpers with my DFC trading in mind. They can be applied to any manual trading where you think they will boost your profits.

--------------------------
Coders, the code in all the helpers is identical; I wrote the code so that all that needs changing is the value of the TradeType variable at line 36. If you add your own chunks of code, here is the easiest way to produce the next 5 variants:
  • add and debug your code to one of the helpers.
  • change the value of TradeType to reflect the OrderType() you wish to send.
  • do a /File/Save As with a filename that reflects the OrderType().
You can easily create one helper to allow all OrderType() to be sent from the single helper by making line 36 and extern input. I created 6 individual ones because I hate faffing around with inputs.
-----------------------

It remains to be seen how useful all this will turn out to be. Play with the helpers and see.[/hide]

:xm:
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

DFC 3stage trading helper EA's

Post by SteveHopwood »

The same bloops that I have described at http://www.stevehopwoodforex.com/phpBB3 ... 72#p153672 and in the subsequent post applies to the helper EA's. The relevant line numbers are 1883 and 1900.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
FXe3
Trader
Posts: 116
Joined: Wed Dec 10, 2014 11:08 pm
Location: Breckenridge, CO

DFC 3stage trading helper EA's

Post by FXe3 »

Steve, thanks for the DIAD heads up and the helper ea's. If you guys sign up for the ebook the creator will send a link to the xcel calculator used with the ea.

Going for such a large percentage win creates a situation that requires small stop losses. Absent a straight away move the likely hood of the trade closing with a win is very small. Would it not make more sense to go for a smaller percentage win, larger stoploss and place the toppers in in strategically placed areas rather than a random percentage of the move, which often would place your trade in the worst point in market structure?

I'm going to give the calculator a whirl and adjust percentage to match market structure. I think the attached chart demonstrated the exact problem I'm describing. If you entered your first topper at 35, 40, or 50% of the move to the blue area below, you've wasted your topper. The uptrend guys are buying the retracement at the confluence of market structure and fibs. The first topper should be entered on the retracement as a limit order as sellers wait on a discount to go short.
You do not have the required permissions to view the files attached to this post.
zyx
Trader
Posts: 84
Joined: Thu Jan 29, 2015 12:42 am
Location: San Diego

DFC 3stage trading helper EA's

Post by zyx »

Exactly what I was thinking, buying at 2 random places with a tight stop and all you can hope for is a 5% win rate lol. Regardless it is a cool idea, but would be better to somehow have it adapt to multiple manual entries on the way up. I guess in that case all u really need though is something to show your floating % of equity in profit from the initial trade and adjust your following trade size accordingly.
Post Reply

Return to “Captain Jack's forum”