5 Ducks Automated

wallywonka
Trader
Posts: 176
Joined: Thu May 12, 2016 7:46 am

5 Ducks Automated

Post by wallywonka »

Hi Steve,

Just looking at your demo trades. There was two big loss trades this week, NZDJPY and EURJPY. Both happened after a big candle movement down before turning around. Just wondering if a candle filter to stop these trades after big candle movements might be worthwhile... Just a thought not sure if it's worthwhile but would have prevented those two trades.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

5 Ducks Automated

Post by SteveHopwood »

wallywonka » Sun Oct 10, 2021 7:53 am wrote:Hi Steve,

Just looking at your demo trades. There was two big loss trades this week, NZDJPY and EURJPY. Both happened after a big candle movement down before turning around. Just wondering if a candle filter to stop these trades after big candle movements might be worthwhile... Just a thought not sure if it's worthwhile but would have prevented those two trades.
For those of you without the chart, the blue rectangle highlights what happened:
NZDJPYH4.png
The two red candles had moved just over 100 pips before the trade was taken - the HGI signal has disappeared. The manual traders would have taken one look at that, shuddered gently and moved on.

So yes, we need such a filter.

:xm: :rocket:
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. [email protected] 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.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

5 Ducks Automated

Post by SteveHopwood »

I have added the distance movement thingy - scroll down post 1 to MaxMovementAllowedPips to read what I have coded. There may be bugs so code gurus can follow it in the bool confirmMaxPipsMovementIsOk(string symbol, int pairIndex, int type) function, itself called from within confirmLongSignal(string symbol, int pairIndex) and confirmShortSignal(string symbol, int pairIndex).

The update is in the zip in post 1. I attach it here to save redownloading the zip.

I just had a thought. This is perfect for calculating MaxMovementAllowedPips using ATR - cancel the trade if the market has already moved more than x% (say 50) of the D1 ATR. Any ideas folks?

:xm: :rocket:
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. [email protected] 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.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

5 Ducks Automated

Post by SteveHopwood »

I have added the option to use ATR to calculate MaxMovementAllowedPips. This will override any value that you input into the variable. The default inputs calculate ATR on the D1 using a 20 period that equates to one month of trading. The updated version is in the post 1 zip and I attach it here as well.

It is a simple DIY. Do a search for:
extern int MaxMovementAllowedPips=50;

Insert this underneath:

Code: Select all

//Using ATR to calculate MaxMovementAllowedPips
extern bool    UseMmaAtr=true;
extern int     MmaAtrPeriod=20;
extern ENUM_TIMEFRAMES MmaAtrTimeFrame=PERIOD_D1;
extern int     MmaPercentOfAtrToUse=100;

Go to this function: bool confirmMaxPipsMovementIsOk(string symbol, int pairIndex, int type)
Scroll down to below the 'getBasics(symbol);' command and add this code block:

Code: Select all

   //Using ATR to calculate MaxMovementAllowedPips.
   //This overrides any user input to MaxMovementAllowedPips
   if (UseMmaAtr)
   {
      double atrVal = getAtr(symbol, MmaAtrTimeFrame, MmaAtrPeriod, 0) * factor;
      atrVal= (atrVal * MmaPercentOfAtrToUse) / 100;
      MaxMovementAllowedPips = (int) atrVal;
   }//if (UseMmaAtr)
Then go to the void displayUserFeedback() function and scroll down to:
for (int pairIndex = 0; pairIndex <= ArraySize(tradePair) - 1; pairIndex++)

Replace the code block with this:

Code: Select all

   for (int pairIndex = 0; pairIndex <= ArraySize(tradePair) - 1; pairIndex++)
   {
      
      string symbol = tradePair[pairIndex];//Makes typing easier
      text = tradePair[pairIndex] + "  " + hgiStatus[pairIndex];
      if (UseMmaAtr)
      {
         getBasics(symbol);
         double atrVal = getAtr(symbol, MmaAtrTimeFrame, MmaAtrPeriod, 0) * factor;
         atrVal = (atrVal * MmaPercentOfAtrToUse)  / 100;
         MaxMovementAllowedPips = (int) atrVal;
         text = text + ": MaxMovementAllowedPips = " + IntegerToString(MaxMovementAllowedPips);
         //text = text + ": ATR = " + DoubleToStr(atrVal, digits);
      }//if (UseMmaAtr)
      
      SM(text + NL);
         
   }//for (int pairIndex = 0; pairIndex <= ArraySize(tradePair) - 1; pairIndex++)
   
We will remove the display element once we have worked out the best percentage to use - 100% by default.

:xm: :rocket:
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. [email protected] 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.
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

5 Ducks Automated

Post by Wavegarrick »

I just had a thought. This is perfect for calculating MaxMovementAllowedPips using ATR - cancel the trade if the market has already moved more than x% (say 50) of the D1 ATR. Any ideas folks?

:xm:
I think this is a very good addition, Steve. :good:
Cheers
Leon
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

5 Ducks Automated

Post by SteveHopwood »

Wavegarrick » Fri Oct 15, 2021 4:19 pm wrote:
I just had a thought. This is perfect for calculating MaxMovementAllowedPips using ATR - cancel the trade if the market has already moved more than x% (say 50) of the D1 ATR. Any ideas folks?

:xm:
I think this is a very good addition, Steve. :good:
Cheers
Leon
Sing out if you want it added to Sharkey.

:xm: :rocket:
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. [email protected] 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.
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

5 Ducks Automated

Post by Wavegarrick »

Hi Steve,
I would be very grateful if this can be added to Sharkey.
Many thanks,
Leon.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

5 Ducks Automated

Post by SteveHopwood »

Wavegarrick » Mon Oct 18, 2021 7:24 am wrote:Hi Steve,
I would be very grateful if this can be added to Sharkey.
Many thanks,
Leon.
Here you are - V 1r attached. The inputs are underneath the Peaky inputs.

You have to specify your TradingTimeFrame, so watch out for that. It is a new input specific to Sharkey, who otherwise is merely a slave to TDesk and the extra specific requirements of Richard.

Do a search for UseMaxMovementAllowedFilter if you want to follow the code.

:xm: :rocket:
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. [email protected] 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.
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

5 Ducks Automated

Post by Wavegarrick »

Awesome Steve,
Thank you :good:
Post Reply

Return to “Automated trading systems”