Bob's Biggest Balls Ever

Post Reply
phaholj
Trader
Posts: 25
Joined: Thu Aug 16, 2012 6:25 am

Re: Bob's Biggest Balls Ever

Post by phaholj »

On Cowboy IBFX Empty4 platform the following symbols are not available CADCHF and NZDCAD.
fmuir
Trader
Posts: 87
Joined: Sun Apr 01, 2012 7:32 am
Location: Seattle, WA, USA

Re: Bob's Biggest Balls Ever

Post by fmuir »

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
phaholj
Trader
Posts: 25
Joined: Thu Aug 16, 2012 6:25 am

Re: Bob's Biggest Balls Ever

Post by phaholj »

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.
House Brick
Posts: 2
Joined: Mon Sep 03, 2012 9:59 pm

Re: Bob's Biggest Balls Ever

Post by House Brick »

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

Re: Bob's Biggest Balls Ever

Post by SteveHopwood »

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
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. pianodoodler@hotmail.com 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
McNish
Trader
Posts: 227
Joined: Tue Nov 06, 2012 3:56 pm

Re: Bob's Biggest Balls Ever

Post by McNish »

@ 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
Last edited by McNish on Fri Jan 25, 2013 2:33 pm, edited 1 time in total.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Bob's Biggest Balls Ever

Post by SteveHopwood »

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
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. pianodoodler@hotmail.com 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
McNish
Trader
Posts: 227
Joined: Tue Nov 06, 2012 3:56 pm

Re: Bob's Biggest Balls Ever

Post by McNish »

@ 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.
User avatar
Wiggy1965
Trader
Posts: 326
Joined: Fri Jan 04, 2013 11:58 am
Location: Melbourne - Australia

Re: Bob's Biggest Balls Ever

Post by Wiggy1965 »

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

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

Wiggy
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Bob's Biggest Balls Ever

Post by SteveHopwood »

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
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. pianodoodler@hotmail.com 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.
Post Reply

Return to “Automated trading systems”