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

Bob's Biggest Balls Ever
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1375
Page 22 of 26
Author:  phaholj [ Fri Jan 25, 2013 7:26 am ]
Post subject:  Re: Bob's Biggest Balls Ever

On Cowboy IBFX Empty4 platform the following symbols are not available CADCHF and NZDCAD.
Author:  fmuir [ Fri Jan 25, 2013 8:40 am ]
Post subject:  Re: Bob's Biggest Balls Ever

phaholj wrote:@fmuir
Regarding the logical operators && or || in the order of precedence of logical operators, it is best to use the brackets.
I realized that most of the mistakes i made through the code is the order of precedence.
The most reliable one is the use of brackets.

Phaholj
Thanks
@ phaholj,
Thanks for your remarks!

Regarding the two symbols that Cowboy IBFX doesn't support. Just remove them by editing the symbolsToTrade variable (I think), which is near the end of your setfile.

Regards,
-Frank
Author:  phaholj [ Fri Jan 25, 2013 8:43 am ]
Post subject:  Re: Bob's Biggest Balls Ever

fmuir wrote:
phaholj wrote:@fmuir
Regarding the logical operators && or || in the order of precedence of logical operators, it is best to use the brackets.
I realized that most of the mistakes i made through the code is the order of precedence.
The most reliable one is the use of brackets.

Phaholj
Thanks
@ phaholj,
Thanks for your remarks!

Regarding the two symbols that Cowboy IBFX doesn't support. Just remove them by editing the symbolsToTrade variable (I think), which is near the end of your setfile.

Regards,
-Frank
Thanks
I have already done that.
Author:  House Brick [ Fri Jan 25, 2013 9:28 am ]
Post subject:  Re: Bob's Biggest Balls Ever

fmuir wrote:@SteveHopwood,

Would you please take a look at the following code snippet. There are four similar blocks in LookForTradingOpportunities.

The snippet follows:

Code: Select all

     /////////////////////////////////////////////////////////////////////////////
     //Start of long scalp trade block
     if (ScalpTrading)
         if (!IsScalpTradeOpen(symbol))//1
            if (symbolValues[cc][iDO] > symbolValues[cc][iDP])//2
   //            if (iOpen(symbol, PERIOD_M15, 1) < symbolValues[cc][iDO] )//3
   //               if (bid > symbolValues[cc][iDO] )//3
                     if (ScalpSlopeTF == 0 || ScalpSlopeVal[cc] >= ScalpBuyLevel)//4
                        if (IsTradingAllowed(symbol, scalptrade) )//5
                           if (UseZeljko && BalancedPair(symbol, OP_BUY) )//5
                //            if (!UseFilter_ADX || CheckADX(symbol, buy))//6
                                 if (TradeLong)//5
                //                  if (!UseFilter_Doji || symbolValues[cc][iDoji] != down)//7
                                    /////////////////
                                    {
                                       TradeScalpLong(symbol);
                                       return;
                                    }
                                    /////////////////
               
      //End of long scalp trade block
      /////////////////////////////////////////////////////////////////////////////
[/size]
While this snippet looks neat, as you had said, there are inherent problems with it. Each if statment must evaluate to true to get to the next lower if statement. If they evaluate to false, then the potenial trade will fall out of the side and never be placed.

I have experienced a problem with the variable UseZeljko. Trades will be placed if it is set to true (had 3 scalp trades opened). No trades were placed when it is set to false. You would think that if you don't want to use the filter, then it wouldn't have any effect on a trade, but the trade would be placed, if the other conditions were favorable.

I had set UseFilter_ADX and UseFilter_Doji to false. I haven't gotten to the point of validating those if statements, that is why they're disabled. Intuitively you would think that if UseFilter_ADX or UseFilter_Doji were set to false, then the two filters are not used. But, the way that the if statements are constructed, the two filters are used irregardless of the setting of the two variables. Is this is what is wanted? If it is then the two variables should be removed from the if statements.

What do you think? And, please, don't let it affect your mood?! Life is too short, to allow yourself to be negatively affected by something that you love doing!

Regards,
-Frank
I think the check for UseZeljko isn't quite what is intended.

Code: Select all

                           if (UseZeljko && BalancedPair(symbol, OP_BUY) )//5 #1
// Change to
                           if (!UseZeljko || BalancedPair(symbol, OP_BUY) )//5 #2
// Or written out in full
                           if (!UseZeljko || (UseZeljko && BalancedPair(symbol, OP_BUY)) )//5
[/size]

In #1 if UseZeljko is meant to be a switch i.e turn off to ignore check, then whenever it is off you won't flow down to the next check or trade because it HAS to be true to pass the test.
In #2 (like in the other checks) if UseZeljko is off - continue, or if it is on then BalancedPair also has to be true to continue.

Sorry if stating the obvious or if misunderstood what UseZeljko is for.

For ScalpSlopeTF == 0 it's fine as is, think of it as:

Code: Select all

   if (!ScalpSlopeTF || ScalpSlopeVal[cc] >= ScalpBuyLevel)//4
[/size]

Cheers,
HouseBrick
Author:  SteveHopwood [ Fri Jan 25, 2013 11:24 am ]
Post subject:  Re: Bob's Biggest Balls Ever

House Brick wrote:
fmuir wrote:@SteveHopwood,

Would you please take a look at the following code snippet. There are four similar blocks in LookForTradingOpportunities.

The snippet follows:

Code: Select all

     /////////////////////////////////////////////////////////////////////////////
     //Start of long scalp trade block
     if (ScalpTrading)
         if (!IsScalpTradeOpen(symbol))//1
            if (symbolValues[cc][iDO] > symbolValues[cc][iDP])//2
   //            if (iOpen(symbol, PERIOD_M15, 1) < symbolValues[cc][iDO] )//3
   //               if (bid > symbolValues[cc][iDO] )//3
                     if (ScalpSlopeTF == 0 || ScalpSlopeVal[cc] >= ScalpBuyLevel)//4
                        if (IsTradingAllowed(symbol, scalptrade) )//5
                           if (UseZeljko && BalancedPair(symbol, OP_BUY) )//5
                //            if (!UseFilter_ADX || CheckADX(symbol, buy))//6
                                 if (TradeLong)//5
                //                  if (!UseFilter_Doji || symbolValues[cc][iDoji] != down)//7
                                    /////////////////
                                    {
                                       TradeScalpLong(symbol);
                                       return;
                                    }
                                    /////////////////
               
      //End of long scalp trade block
      /////////////////////////////////////////////////////////////////////////////
[/size]
While this snippet looks neat, as you had said, there are inherent problems with it. Each if statment must evaluate to true to get to the next lower if statement. If they evaluate to false, then the potenial trade will fall out of the side and never be placed.

I have experienced a problem with the variable UseZeljko. Trades will be placed if it is set to true (had 3 scalp trades opened). No trades were placed when it is set to false. You would think that if you don't want to use the filter, then it wouldn't have any effect on a trade, but the trade would be placed, if the other conditions were favorable.

I had set UseFilter_ADX and UseFilter_Doji to false. I haven't gotten to the point of validating those if statements, that is why they're disabled. Intuitively you would think that if UseFilter_ADX or UseFilter_Doji were set to false, then the two filters are not used. But, the way that the if statements are constructed, the two filters are used irregardless of the setting of the two variables. Is this is what is wanted? If it is then the two variables should be removed from the if statements.

What do you think? And, please, don't let it affect your mood?! Life is too short, to allow yourself to be negatively affected by something that you love doing!

Regards,
-Frank
I think the check for UseZeljko isn't quite what is intended.

Code: Select all

                           if (UseZeljko && BalancedPair(symbol, OP_BUY) )//5 #1
// Change to
                           if (!UseZeljko || BalancedPair(symbol, OP_BUY) )//5 #2
// Or written out in full
                           if (!UseZeljko || (UseZeljko && BalancedPair(symbol, OP_BUY)) )//5
[/size]

In #1 if UseZeljko is meant to be a switch i.e turn off to ignore check, then whenever it is off you won't flow down to the next check or trade because it HAS to be true to pass the test.
In #2 (like in the other checks) if UseZeljko is off - continue, or if it is on then BalancedPair also has to be true to continue.
Nice spot. Thanks.

V 1k with this fixed is in post 1. This is an essential fix.

:D
Author:  McNish [ Fri Jan 25, 2013 12:05 pm ]
Post subject:  Re: Bob's Biggest Balls Ever

@ Steve : Thanks for the fix and a very critical one too since I guess that's what prevented trades. It seemed obvious after Frank's and HB's spot. I did get close to it yesterday but retreated for lack of confidence.

Some more general observations, only in scalp segment of LookForTradingOppertunities. IsTradingAllowed filter (5.a) contains three filters, - Spread, Swap and trade currency twice. Here, the swap filter is checked and the TradeLong / TradeShort is given a boolean value. Fine. Thereafter in rule 5.C (just before Doji Check, rule 7), why check for the same value of TradeLong / Short again?
Edit : TradeLong/Short are from swap filter module and swap filter is for trend trades only, then why use them on standalone basis (5.C rule) in scalp segment of LookForTradingOppertunities?

One more, in the Balanced Pair filter module, there are only buy type checks, i.e if (type == OP_BUY || type == OP_BUYSTOP). No similar sell checks? Or are they not required? However, in the LookForTradingOppertunities under short scalp, how will this work - (UseZeljko || BalancedPair(symbol, OP_SELL) ) //5 - if OP_SELL condition is not initialized at all?

If the above two observations are incorrect, please pardon me as I have limited Empty4 coding knowledge. In that case, someone direct me to the right place where I can correct my notion of it. Thank You.

Edit : Finally, getting scalp trades with - if (!UseZeljko || BalancedPair(symbol, OP_B/S) )//5
Author:  SteveHopwood [ Fri Jan 25, 2013 2:00 pm ]
Post subject:  Re: Bob's Biggest Balls Ever

Just had umpteen GU NY trend sell trades sent, so there is something wrong in the code that allows a new trade each day. I will look at this over the weekend.

:D
Author:  McNish [ Fri Jan 25, 2013 3:10 pm ]
Post subject:  Re: Bob's Biggest Balls Ever

@ Steve : One way around for restricting multiple trend trades could be to check the time stamp of the pair and restrict another trend trade on the pair if the last trend trade for it is of current date. With this functionality, one can do away with Max Trades restriction also. Just my 2 cents.
Author:  Wiggy1965 [ Fri Jan 25, 2013 3:14 pm ]
Post subject:  Re: Bob's Biggest Balls Ever

i had the GU one the other day, i posted abut it...;-)

did you have fun closing all those trades...;-)

Wiggy
Author:  SteveHopwood [ Fri Jan 25, 2013 3:39 pm ]
Post subject:  Re: Bob's Biggest Balls Ever

Wiggy1965 wrote:i had the GU one the other day, i posted abut it...;-)

did you have fun closing all those trades...;-)

Wiggy
Got a script.......

:D
All times are UTC Page 22 of 26