Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Systems (https://www.forexfactory.com/forumdisplay.php?f=71)
-   -   MM (Money Maker) Detective Indicator (https://www.forexfactory.com/showthread.php?t=911239)

robots4me Jul 11, 2019 11:05pm | Post# 4801

Thanks R4ME for transparency. Is this still correct and do you plan on opening up any other buffers. #define INDEX_EXPORTED_BUY (14) #define INDEX_EXPORTED_SELL (15) #define INDEX_EXPORTED_EXIT (16)

@Pip-Miner -- the indices and inputs have changed since I last posted that. Here are the new index settings and how I call iCustom() from my EAs:


enum ENUM_EXIT_CONDITION {
EXIT_CROSS_MIDLINE = 101, // Exit when price crosses midline
EXIT_CROSS_OPPOSITE_BAND = 102, // Exit when price crosses opposite band
EXIT_CLOSE_ABOVE_MIDLINE = 103 // Exit when price closes above / below midline
};


#define INDEX_EXPORTED_BUY (15)
#define INDEX_EXPORTED_SELL (16)
#define INDEX_EXPORTED_EXIT (17)



//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
string g_strCustomPath_BishopDotun = "R4M-BD-ADR";
bool CustomValue_BishopDotun(string strSymbol, int iPeriod, int shift, int iPercentADR, int& iExportedBUY, int& iExportedSELL, int& iExportedEXIT,
int iMaxBars = 100, int iNumberOfDaysToAverage=20, ENUM_EXIT_CONDITION eWhichExitCondition=EXIT_CROSS_MIDLINE, ENUM_BD_TIMEFRAMES eBDTimeFrame=BD_TF_10080,
bool bApplyMomentumFilter=false)
{
string strMessage = "";

strMessage = StringFormat("*** ENTERING iCustom | %s", WindowExpertName());
// Print(strMessage);

ResetLastError();

iExportedBUY = (int)iCustom(strSymbol, iPeriod /*timeframe*/, g_strCustomPath_BishopDotun,
"", eBDTimeFrame, iPercentADR, iMaxBars, iNumberOfDaysToAverage, eWhichExitCondition, bApplyMomentumFilter,
INDEX_EXPORTED_BUY, shift);

iExportedSELL = (int)iCustom(strSymbol, iPeriod /*timeframe*/, g_strCustomPath_BishopDotun,
"", eBDTimeFrame, iPercentADR, iMaxBars, iNumberOfDaysToAverage, eWhichExitCondition, bApplyMomentumFilter,
INDEX_EXPORTED_SELL, shift);

iExportedEXIT = (int)iCustom(strSymbol, iPeriod /*timeframe*/, g_strCustomPath_BishopDotun,
"", eBDTimeFrame, iPercentADR, iMaxBars, iNumberOfDaysToAverage, eWhichExitCondition, bApplyMomentumFilter,
INDEX_EXPORTED_EXIT, shift);

// if (iExportedEXIT > 0)
// {
// strMessage = StringFormat("*** ExportEXIT iCustom | %s | iExportedEXIT: %d | shift: %d", WindowExpertName(), iExportedEXIT, shift);
// Print(strMessage);
// }

int iLastError = GetLastError();
if (0 != iLastError)
{
// NOTE: 4072 ==> "Cannot load custom indicator"
strMessage = StringFormat("*** [FAILED]: %s: %s: ErrorCode: %d: -- %s",
"CustomValue_BishopDotun", strSymbol, iLastError, ErrorDescription(iLastError));
Print(strMessage);
Alert(strMessage);
return (false);
}

return (true);
}

robots4me Jul 11, 2019 11:41pm | Post# 4802

2 Attachment(s)
{quote} Does not repaint after candle close. Mq4 is posted here. https://www.forexfactory.com/showthr...4#post12368854
@skyway -- it may work with manual trading, but not algorithmically. Check out the screen shots below:

Click to Enlarge

Name: Entry-TrendForce.png
Size: 69 KB
In the screen shot above there are a number of midlines the TrendDirection&Force indicator should have marked, but it didn't.


Click to Enlarge

Name: Entry-TrendForce-2.png
Size: 72 KB
And on a short time frame (M5) it does a better job of marking -- but too late. I didn't cherry-pick the screen shot above -- I just took the most recent EURUSD-M5. The TrendDirection&Force would have generated a SELL -- but the bar that crossed the midline closed below the lower band and we should instead be preparing to BUY.

This is why I'm not inclined to keep playing around with indicators -- especially when it comes to automation. For manual trading -- sure, since you get to apply your discretionary experience. But for automation we have to follow rules that have to be accurate almost all the time.


EDIT: Look at all those nice juicy signals above and below the bands -- are we so desperate we need to make this more complicated just to grab one more trade that originates around the midline?

skyway Jul 12, 2019 12:00am | Post# 4803

1 Attachment(s)
{quote} @skyway -- it may work with manual trading, but not algorithmically. Check out the screen shots below: {image} In the screen shot above there are a number of midlines the TrendDirection&Force indicator should have marked, but it didn't. {image} And on a short time frame (M5) it does a better job of marking -- but too late. I didn't cherry-pick the screen shot above -- I just took the most recent EURUSD-M5. The TrendDirection&Force would have generated a SELL -- but the bar that crossed the midline closed below the lower band and we should...
Try my settings on m5 timeframe -
BD 1440, 33%
Trenddirection&force 36, level 0.5, -0.5
Click to Enlarge

Name: 1.PNG
Size: 50 KB

bishopdotun Jul 12, 2019 12:44am | Post# 4804

2 Attachment(s)
Don't make it more complicated than it is. The FX-RSI-Momentum indi is ok. We just need the filter to control the frequency of trades. That's all. The rest could lead to overkill. Even without filters, everything is ok.

This has been running independently and the EA is doing the job nicely. Look at the nice equity curve below. Just 1hr ago, it reached max equity with zero DD.

The DD spikes when loading new trades but drops when the actual reversal kicks in. And the emergency exit is there as soon as we get an opposite entry. I can handle this all day and all night. I will be happy to step in occasionally to take some profits if I feel I can't wait.

Click to Enlarge

Name: Screenshot 2019-07-12 at 06.35.02.png
Size: 1.5 MB

Click to Enlarge

Name: Screenshot 2019-07-12 at 06.37.32.png
Size: 1.1 MB

mixedbags Jul 12, 2019 12:59am | Post# 4805

{quote} Try my settings on m5 timeframe - BD 1440, 33% Trenddirection&force 36, level 0.5, -0.5 {image}
BD 1440, 35% - 45% curve fit for different pairs. Running this setting on live, so far VERY good.

Robot Trader Jul 12, 2019 1:02am | Post# 4806

Don't make it more complicated than it is. The FX-RSI-Momentum indi is ok. We just need the filter to control the frequency of trades. That's all. The rest could lead to overkill. Even without filters, everything is ok. This has been running independently and the EA is doing the job nicely. Look at the nice equity curve below. Just 1hr ago, it reached max equity with zero DD. The DD spikes when loading new trades but drops when the actual reversal kicks in. And the emergency exit is there as soon as we get an opposite entry. I can handle this all...
Hi BD,

Could I please request a file on your Thread (Post 1) that contains SET files for each TF that have been tried and tested and give Excellent results, I'm not interested in just good results, they must be Excellent

Also which currency pairs they have been tested on, with the average Daily Range being different, I suspect not one SET file will fit all.

Regards

RT

bishopdotun Jul 12, 2019 1:11am | Post# 4807

1 Attachment(s)
{quote} Hi BD, Could I please request a file on your Thread (Post 1) that contains SET filers for each TF that have been tried and tested and give Excellent results, I'm not interested in just good results, they must be Excellent Also which currency pairs they have been tested on, with the average Daily Range being different, I suspect not one SET file will fit all. Regards RT
Yes will be doing that. I will be sharing updates. I am just getting a feel of what I am comfortable with on my live account before I share. And I don't waste much time on demo.

I switched a few pairs to M15 to check if that reduces frequency of trades while I maintained same settings for LTF. M15 seems to reduce the frequency but will also leave out plenty potential pips. There is always something to give.

You wont always find this much precision in opening and closing trades while you sleep. Been around for a while to know that. K.I.S.S.

Click to Enlarge

Name: Screenshot 2019-07-12 at 07.07.31.png
Size: 818 KB

robots4me Jul 12, 2019 4:10am | Post# 4808

1 Attachment(s)
R4M BD ADR All Pairs Trading EA (R4M-BD-ADR-AllPairsEA.ex4)

I've uploaded a new trading EA -- R4M-BD-ADR-AllPairsEA.ex4 -- to the other thread -- "Custom Indicators for TMA-ADR Reversal Trading and BBMA" (https://www.forexfactory.com/showthread.php?t=920925). All indicators are bundled in a single *.zip file. Indicators must be installed under MT4's 'Indicators' folder and EAs must be installed under the 'Experts' folder.

================================================
NOTE: I've also updated the other BD EAs and indicators:
R4M-BD-ADR-EA.ex4 (single-pair trading EA)
R4M-BD-ADR-DashboardEA.ex4 (dashboard EA)
R4M-BD-ADR.ex4 (indicator)
I've uploaded new versions of the BD indicator and EAs -- this is now version "1.00.19193". The software can be downloaded from the other thread -- "Custom Indicators for TMA-ADR Reversal Trading and BBMA" (https://www.forexfactory.com/showthread.php?t=920925). All indicators are bundled in a single *.zip file. Indicators must be installed under MT4's 'Indicators' folder and EAs must be installed under the 'Experts' folder.
================================================

R4M-BD-ADR-AllPairsEA.ex4 is a trading EA that relies on signals generated by R4M-BD-ADR indicator. To use the EA simply attach it to a chart of the pair you wish to trade. D1 is the preferred time frame, but you are welcome to use others, as well.

R4M-BD-ADR-AllPairsEA.ex4 trades multiple pairs at the same time -- in contrast to the other trading EA (R4M-BD-ADR-EA.ex4) that trades only the pair associated with the chart it is attached to.

There are two ways to specify which pairs to trade -- all pairs listed in your Market Watch window, or manually entering them in the EA's input settings. From a practical point of view, I recommend not to exceed 28 pairs. The computations are fairly CPU-intensive and too many pairs will cause MT4 to freeze. Also, it is probably a good idea to run this in a separate MT4 session that does not include other charts. It is very easy to launch more than one MT4 session so this shouldn't be an issue.

Click to Enlarge

Name: R4M-BD-ADR-AllPairsEA.png
Size: 18 KB

There are a few settings to be aware of -- really not too complicated. However, please be aware these settings have a huge effect on the EAs performance. For optimal performance each pair and time frame will require different settings. When using the single-pair trading EA (R4M-BD-ADR-EA.ex4) you could apply calibrated settings that were specifically tailored for a particular pair / time frame. But for this "All Pair" EA we have to compromise and apply one set of parameters that will be used for all pairs. Perhaps in the future we can create a "Calibration Table" the EA can use to look-up the best parameters for each pair / time frame.

Below I will briefly describe the most important settings:

BD Time Frame:
The BD strategy is based on the centered TMA indicator which includes 3 bands -- middle, upper and lower. The BD Time Frame is the time frame used to compute these bands and will always be higher than your chart's time frame. For example, the default setup is to use a BD Time Frame of W1 on a D1 chart. Since a week includes 5 trading days, then that means every W1 "bar" will include 5 D1 bars. But since we are drawing bands, then that means every TMA horizontal step will cover 5 D1 bars.

Percent ADR:
The upper and lower TMA bands are drawn as offsets from the midline. This offset is computed as a percent of the ADR of the current pair. The default is 100%. So, for example, if a pair's ADR is 48 pips then the upper and lower bands should track with the midline -- 48 pips above and 48 pips below.

Number Days to Average ADR:
The ADR (Average Daily Range) is an average of the delta (i.e. difference) between each days High and Low over a period of days. The default is 20 days.

Exit Conditions:
Three types of Exit conditions (signals) are supported: Crossing the midline, crossing the opposite band, closing above / below the midline. The default is "crossing the midline".

Apply Momentum Filter:
I've adapted the momentum filter from the SpikeHunter indicator to also work with this EA. It is a combination of two momentum indicators -- @Nih98's FX RSI indicator plus Stochastic momentum index (SMI). The default for this parameter is 'false'.

Lot Size:
Self explanatory. The default is 0.01.

StopLoss Fraction ADR:
The StopLoss is calculated as a fraction of the current pair's ADR (in pips).

TakeProfit Fraction ADR:
Similarly, the TakeProfit is calculated as a fraction of the current pair's ADR (in pips).

bishopdotun Jul 12, 2019 4:27am | Post# 4809

R4M BD ADR All Pairs Trading EA (R4M-BD-ADR-AllPairsEA.ex4) I've uploaded a new trading EA -- R4M-BD-ADR-AllPairsEA.ex4 -- to the other thread -- "Custom Indicators for TMA-ADR Reversal Trading and BBMA" (https://www.forexfactory.com/showthread.php?t=920925). All indicators are bundled in a single *.zip file. Indicators must be installed under MT4's 'Indicators' folder and EAs must be installed under the 'Experts' folder. ================================================ NOTE: I've also updated the other BD EAs and indicators: R4M-BD-ADR-EA.ex4...
Wow...wow.... Thank you.

bishopdotun Jul 12, 2019 4:36am | Post# 4810

4 Attachment(s)
Great results so far. This thing pips all day and all night.

Click to Enlarge

Name: Screenshot 2019-07-12 at 10.22.57.png
Size: 1.8 MB

Click to Enlarge

Name: Screenshot 2019-07-12 at 10.13.28.png
Size: 2.1 MB

Click to Enlarge

Name: Screenshot 2019-07-12 at 10.13.54.png
Size: 2.1 MB

I have now switched all my LTF to M15 and upped my list to 28 pairs. M15 offers lesser trades which now allows me accommodate 28 pairs.

See the shot below. The emergency exit saved the day. Then new trades loaded. Here is something to point out for the next release.
- Sometimes the reversal is instant. Meaning that price moves immediately after the first or second trade. By the time we are shooting the second or third trade, price is already well above the extreme bands. This almost immediately leave us at a disadvantage if price moves back to the extreme bands.

Click to Enlarge

Name: Screenshot 2019-07-12 at 10.06.13.png
Size: 1.1 MB

Request: Is it possible to check that price is still below the band before shooting the trade? I know the bands will shift lower anyway but it could be better to always check that price is below before shooting. In cases where price shoots up or down, we can protect ourselves from surprises. What do you think?

robots4me Jul 12, 2019 4:52am | Post# 4811

Great results so far. This thing pips all day and all night. {image} {image} {image} I have now switched all my LTF to M15 and upped my list to 28 pairs. M15 offers lesser trades which now allows me accommodate 28 pairs. See the shot below. The emergency exit saved the day. Then new trades loaded. Here is something to point out for the next release. - Sometimes the reversal is instant. Meaning that price moves immediately after the first or second trade. By the time we are shooting the second or third trade, price is already well above the extreme...
Request: Is it possible to check that price is still below the band before shooting the trade? I know the bands will shift lower anyway but it could be better to always check that price is below before shooting. In cases where price shoots up or down, we can protect ourselves from surprises.

@bishopdotun -- I don't understand the additional check. Every trade must meet the same requirement -- its Open tick is below (or above) the band. In hindsight price might move against us. But, in real-time, every trade is opened below (or above) a band.

If I'm misunderstanding could you please share a screen shot that explains your request.

bishopdotun Jul 12, 2019 5:28am | Post# 4812

{quote} {quote} @bishopdotun -- I don't understand the additional check. Every trade must meet the same requirement -- its Open tick is below (or above) the band. In hindsight price might move against us. But, in real-time, every trade is opened below (or above) a band. If I'm misunderstanding could you please share a screen shot that explains your request.
Have a closer look at the one in my last post. You will notice exactly when the last trade was taken. It was taken on the last bar on the screen shot and it is well above the lower band.

I took the shot almost immediately.

robots4me Jul 12, 2019 5:36am | Post# 4813

{quote} Have a closer look at the one in my last post. You will notice exactly when the last trade was taken. It was taken on the last bar on the screen shot and it is well above the lower band. I took the shot almost immediately.
@bishopdotun -- okay, but look at that bar -- it's huge. Code-wise there is not much more I can do -- it's a simple comparison of the current Open versus the current lower band. Could it be that the EA requested to open a position but by the time it was processed by your broker the price had jumped (i.e. slippage)?

jdva Jul 12, 2019 5:36am | Post# 4814

{quote} Have a closer look at the one in my last post. You will notice exactly when the last trade was taken. It was taken on the last bar on the screen shot and it is well above the lower band. I took the shot almost immediately.
Yep...I experienced the same behavior on a AU sell

jdva Jul 12, 2019 5:39am | Post# 4815

1 Attachment(s)
{quote} Yep...I experienced the same behavior on a AU sell
Click to Enlarge

Name: R4m EA AU.png
Size: 53 KB

bishopdotun Jul 12, 2019 5:39am | Post# 4816

{quote} @bishopdotun -- okay, but look at that bar -- it's huge. Code-wise there is not much more I can do -- it's a simple comparison of the current Open versus the current lower band. Could it be that the EA requested to open a position but by the time it was processed by your broker the price had jumped (i.e. slippage)?
I understand. It wont change much but its a nice to have.

If we cant solve that please ignore.

robots4me Jul 12, 2019 5:54am | Post# 4817

{quote} Have a closer look at the one in my last post. You will notice exactly when the last trade was taken. It was taken on the last bar on the screen shot and it is well above the lower band. I took the shot almost immediately.
@bishopdotun -- in programming there are sometimes "boundary cases" -- and this may be one -- I'm not sure.

If the EA is attached to a chart and receiving tick data then all is fine.

But let's say you attach the EA to the chart just as the price is spiking. Since the EA compares the Open tick with the lower band and since the lower band hasn't yet shifted upwards, then it thinks it is still okay to open a trade. In other words, since the EA wasn't actually running at the time the Open tick occurred then the comparison may not be valid.

I think this could be addressed but it would require keeping track of ticks. And I'm not sure it is worth it because it's a "boundary case" that rarely occurs -- i.e. you attach the EA to a chart at the same time the price is spiking.

Robot Trader Jul 12, 2019 5:56am | Post# 4818

{quote} {quote} @bishopdotun -- I don't understand the additional check. Every trade must meet the same requirement -- its Open tick is below (or above) the band. In hindsight price might move against us. But, in real-time, every trade is opened below (or above) a band. If I'm misunderstanding could you please share a screen shot that explains your request.
Hi R4M,

Question regards BD's Post 4810

A basket of Sell trades closed at the far left lower band and then I see 2 Buy trades not sure what triggered Ticket 40048076, but that is not the reason for my post.

There was another Buy opportunity marked with a Blue dot 4 steps up from the Right, so is it possible for the EA to handle a Buy while still dealing with open Sells.

One way of doing this would be to have a parameter that you can pick the Buy or Sell option and then you load the EA twice on the same chart one instance set to Buys only trades and the other set to Sells only trades.

Then we can be trading in both directions and not missing trades setups.

Cheers

RT

robots4me Jul 12, 2019 5:57am | Post# 4819

{quote} {image}
@jdva -- since I can see the previous trades then I don't think this is the boundary case I mentioned above. Since it occurred at the time of a large price drop then could it be due to slippage?

El1000 Jul 12, 2019 6:02am | Post# 4820

{quote} In other words, since the EA wasn't actually running at the time the Open tick occurred then the comparison may not be valid. I think this could be addressed but it would require keeping track of ticks. And I'm not sure it is worth it because it's a "boundary case" that rarely occurs -- i.e. you attach the EA to a chart at the same time the price is spiking.
Hi,As you can see on the chart posted by @bishopdotun and @jdva they both had the EA running for some time.


© Forex Factory