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

Multi 10:4 Trader EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1619
Page 61 of 160
Author:  slipshod [ Wed Apr 03, 2013 6:26 am ]
Post subject:  Re: Multi 10:4 Trader EA

Your NZDJPY has the same thing ... looks wrong to me, but I'm no 10.4 expert.

Edit: Looking at the code there's an obvious error. In trendDirect() there's the following:-

Code: Select all

else if (l0 > mA && gRSI < RSITMAlowlevel || a0 < 0)
There should be parentheses to clarify how the || relates to the &&, the logic is unclear. This situation appears four times in the function. Parentheses aside, this code is basically allowing trades to be entered purely on the Awesome Oscillator value regardless of whatever RSI or Stoch might say - is this according to 10.4 logic? Could someone clarify?

Also the setting "UseRSIInsteadOfStoch" is misleading. The function looks at Stoch first and will enter if its value allows it (or AO's for that matter) and then if that setting is true it will look at RSI. The setting should really be called "UseRSIAsWellAsStoch".
Author:  linuspoon [ Wed Apr 03, 2013 6:36 am ]
Post subject:  Re: Multi 10:4 Trader EA

slipshod wrote:Your NZDJPY has the same thing ... looks wrong to me, but I'm no 10.4 expert.

Edit: Looking at the code there's an obvious error. In trendDirect() there's the following:-

Code: Select all

else if (l0 > mA && gRSI < RSITMAlowlevel || a0 < 0)
There should be parentheses to clarify how the || relates to the &&, the logic is unclear. This situation appears four times in the function. Parentheses aside, this code is basically allowing trades to be entered purely on the Awesome Oscillator value regardless of whatever RSI or Stoch might say - is this according to 10.4 logic? Could someone clarify?

Also the setting "UseRSIInsteadOfStoch" is misleading. The function looks at Stoch first and will enter if its value allows it (or AO's for that matter) and then if that setting is true it will look at RSI. The setting should really be called "UseRSIAsWellAsStoch".
Based on Bob's posts, he do not really look at AO for entries. So I will say that this is indeed a bug in the logic.

Linus
Author:  SWG123 [ Wed Apr 03, 2013 6:38 am ]
Post subject:  Re: Multi 10:4 Trader EA

linuspoon wrote: Based on Bob's posts, he do not really look at AO for entries. So I will say that this is indeed a bug in the logic.

Linus
Linus is correct - Bob doesn't use AO for entries.
Author:  slipshod [ Wed Apr 03, 2013 6:40 am ]
Post subject:  Re: Multi 10:4 Trader EA

Ok ... well I'd say its AO that's allowing those entries. Obviously this is something Andy will need to review, but in the meantime I'm going to eliminate all references to a0 in the trendDirect function and see what effect it has.

Edit: Erroneous entries like the AUDJPY are no longer there after I delete them & wait for new pendings to be placed. However I'm still seeing cases where entries that should be placed are not appearing. For instance, on Pepper I've got a pending buy on GBPCHF, which it should - oversold and an uptrend. However on Cowboy IBFX there's no buystops placed & I can't figure out why yet.

Edit #2: I know why, its that useOneDailyTrade setting.
Author:  linuspoon [ Wed Apr 03, 2013 6:46 am ]
Post subject:  Re: Multi 10:4 Trader EA

Hi,

I've made some changes to the code in the trendDirect function and it seems to work properly now.

Here is the modified trendDirect function. Just replace the entire function with this if you want.

Code: Select all

bool trendDirect(string symbol, int type)
{
    double mA   = iMA(symbol, PERIOD_H4, 240, 0, MODE_LWMA, PRICE_OPEN, 0);
    double aO   = GetAo(symbol, PERIOD_H4, 0);
    double sT   = iStochastic(symbol, PERIOD_H4, 5, 3, 3, MODE_LWMA, 1, MODE_SIGNAL, 0);
    double lO   = iLow(symbol, PERIOD_H4, 0);
    double hO   = iHigh(symbol, PERIOD_H4, 0);
    double gRSI = GetSlopeRSI(symbol, PERIOD_H4, 0);

    if (!UseRSIInsteadOfStoch)
    {
         if (type == OP_BUY)
         {
            if (useBothForPullback)
            {
                  if (lO > mA && sT < 20 && aO < 0)
                  return(true);
            }
            else
            if (lO > mA && sT < 20) // || aO < 0)
               return(true);
         }

         if (type == OP_SELL)
         {
            if (useBothForPullback)
            {
                  if (hO < mA && sT > 80 && aO > 0)
                  return(true);
            }
            else
            if (hO < mA && sT > 80) // || aO > 0)
               return(true);
          }
    }

    if (UseRSIInsteadOfStoch)
    {
        if (type == OP_BUY)
        {
            if (useBothForPullback)
            {
                if (lO > mA && gRSI < RSITMAlowlevel && aO < 0)
                    return(true);
            }
            else if (lO > mA && gRSI < RSITMAlowlevel) // || aO < 0)
                return(true);
        }

        if (type == OP_SELL)
        {
            if (useBothForPullback)
            {
                if (hO < mA && gRSI > RSITMAhighlevel && aO > 0)
                    return(true);
            }
            else if (hO < mA && gRSI > RSITMAhighlevel) // || aO > 0)
                return(true);
        }
    }

    return(false);
}
Author:  MrLong [ Wed Apr 03, 2013 7:23 am ]
Post subject:  Re: Multi 10:4 Trader EA

slipshod wrote:Your NZDJPY has the same thing ... looks wrong to me, but I'm no 10.4 expert.

Edit: Looking at the code there's an obvious error. In trendDirect() there's the following:-

Code: Select all

else if (l0 > mA && gRSI < RSITMAlowlevel || a0 < 0)
There should be parentheses to clarify how the || relates to the &&, the logic is unclear. This situation appears four times in the function. Parentheses aside, this code is basically allowing trades to be entered purely on the Awesome Oscillator value regardless of whatever RSI or Stoch might say - is this according to 10.4 logic? Could someone clarify?

Also the setting "UseRSIInsteadOfStoch" is misleading. The function looks at Stoch first and will enter if its value allows it (or AO's for that matter) and then if that setting is true it will look at RSI. The setting should really be called "UseRSIAsWellAsStoch".
Hi slipshod,,

Yes, that is a bug parentheses missing, when I started out coding the EA, entry from the AO is correct,
On page 27 I think it is, of Bobs manual, he says you can enter off either.

To my knowledge, that hasn't changed.

The switch on the daily filter stops the EA taking a trade that has just closed, no more of this
Symbol today.

Andy
Author:  SWG123 [ Wed Apr 03, 2013 7:24 am ]
Post subject:  Re: Multi 10:4 Trader EA

linuspoon wrote:Hi,

I've made some changes to the code in the trendDirect function and it seems to work properly now.

Here is the modified trendDirect function. Just replace the entire function with this if you want.
Thanks!
Author:  mobthehop [ Wed Apr 03, 2013 8:11 am ]
Post subject:  Re: Multi 10:4 Trader EA

MrLong / Andy,

please have a look at this post of NB from today in regard to AO (emphasize added by me...)
http://www.stevehopwoodforex.com/phpBB3 ... 785#p51785
....I am impressed with CandleTiger once again. That guy knows how to write an indi. Me I just use RSI2, W/P/S/R and the 240 line. AO has almost no use for me now. Sometimes I drop down and use DailyP/S/R lines but not very often. .....
Author:  slipshod [ Wed Apr 03, 2013 8:23 am ]
Post subject:  Re: Multi 10:4 Trader EA

Hi Andy, in addition to what mob said above, even if the AO was still in use it still doesn't look right according to the rules in the manual. The code's just checking for whether its positive for buys and negative for sells, but the rules imply that you enter on the cross of AO from neg to pos or vice versa.
Author:  MrLong [ Wed Apr 03, 2013 9:20 am ]
Post subject:  Re: Multi 10:4 Trader EA

slipshod wrote:Hi Andy, in addition to what mob said above, even if the AO was still in use it still doesn't look right according to the rules in the manual. The code's just checking for whether its positive for buys and negative for sells, but the rules imply that you enter on the cross of AO from neg to pos or vice versa.
Hi slipshod,

If that is the case, my interpretion is wrong, I'll correct it
next week, unless you would like to correct it and publish the code to
the members.

Thanks
Andy
All times are UTC Page 61 of 160