Multi 10:4 Trader EA

Post Reply
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

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".
linuspoon
Trader
Posts: 23
Joined: Fri Sep 14, 2012 5:52 am

Re: Multi 10:4 Trader EA

Post by linuspoon »

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
SWG123
Trader
Posts: 565
Joined: Wed Nov 16, 2011 3:02 pm
Location: Cape Town

Re: Multi 10:4 Trader EA

Post by SWG123 »

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.
Last edited by SWG123 on Wed Apr 03, 2013 6:48 am, edited 1 time in total.
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

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.
Last edited by slipshod on Wed Apr 03, 2013 6:53 am, edited 2 times in total.
linuspoon
Trader
Posts: 23
Joined: Fri Sep 14, 2012 5:52 am

Re: Multi 10:4 Trader EA

Post by linuspoon »

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);
}
MrLong

Re: Multi 10:4 Trader EA

Post by MrLong »

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
You do not have the required permissions to view the files attached to this post.
Last edited by MrLong on Wed Apr 03, 2013 7:39 am, edited 1 time in total.
SWG123
Trader
Posts: 565
Joined: Wed Nov 16, 2011 3:02 pm
Location: Cape Town

Re: Multi 10:4 Trader EA

Post by SWG123 »

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!
User avatar
mobthehop
Trader
Posts: 362
Joined: Wed Nov 16, 2011 12:16 am

Re: Multi 10:4 Trader EA

Post by mobthehop »

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. .....
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

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.
MrLong

Re: Multi 10:4 Trader EA

Post by MrLong »

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
Post Reply

Return to “Nanningbob 10.x”