stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

5 Ducks Automated
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=6085
Page 2 of 2
Author:  wallywonka [ Sun Oct 10, 2021 7:53 am ]
Post subject:  5 Ducks Automated

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.
Author:  SteveHopwood [ Sun Oct 10, 2021 9:58 am ]
Post subject:  5 Ducks Automated

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:
Author:  SteveHopwood [ Sun Oct 10, 2021 4:03 pm ]
Post subject:  5 Ducks Automated

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:
Author:  SteveHopwood [ Fri Oct 15, 2021 3:56 pm ]
Post subject:  5 Ducks Automated

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:
Author:  Wavegarrick [ Fri Oct 15, 2021 4:19 pm ]
Post subject:  5 Ducks Automated

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
Author:  SteveHopwood [ Sun Oct 17, 2021 7:50 pm ]
Post subject:  5 Ducks Automated

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:
Author:  Wavegarrick [ Mon Oct 18, 2021 7:24 am ]
Post subject:  5 Ducks Automated

Hi Steve,
I would be very grateful if this can be added to Sharkey.
Many thanks,
Leon.
Author:  SteveHopwood [ Mon Oct 18, 2021 8:43 am ]
Post subject:  5 Ducks Automated

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:
Author:  Wavegarrick [ Mon Oct 18, 2021 2:35 pm ]
Post subject:  5 Ducks Automated

Awesome Steve,
Thank you :good:
All times are UTC Page 2 of 2