Bob and Jem and Shelley's Pivot Basket auto-trader

Share your 10.x automated traders here.
Post Reply
garyfritz

Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Post by garyfritz »

Ah, I think I have it, Steve.

With AllowAdditionsToBasket = false, it monitors all your pairs, looks continuously for pairs that setup with a pullback, then notes when those pairs trigger by crossing the pivot. When enough pairs have triggered, it launches the basket. E.g. if 8 pairs have set up, and 4 have triggered, and MinimumPercentOfBasket = 50, then it opens positions on all 8 pairs.

With AllowAdditionsToBasket = true, it monitors as before, but it immediately adds open positions for any pair that triggers. The size of the basket can vary as pairs are added, so you'd want to use the Adaptive TP/SL/etc.

Have I got that right?

I'm not sure which model would work better. I suspect adding when the trigger might be best but we'll have to see.

PS: Happy birthday wifey, and enjoy yourself Steve!
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 and Jem and Shelley's Pivot Basket auto-trader

Post by SteveHopwood »

garyfritz wrote:Ah, I think I have it, Steve.

With AllowAdditionsToBasket = false, it monitors all your pairs, looks continuously for pairs that setup with a pullback, then notes when those pairs trigger by crossing the pivot. When enough pairs have triggered, it launches the basket. E.g. if 8 pairs have set up, and 4 have triggered, and MinimumPercentOfBasket = 50, then it opens positions on all 8 pairs.

With AllowAdditionsToBasket = true, it monitors as before, but it immediately adds open positions for any pair that triggers. The size of the basket can vary as pairs are added, so you'd want to use the Adaptive TP/SL/etc.

Have I got that right?
Couldn't have put it better myself. Didn't put it better myself.
PS: Happy birthday wifey, and enjoy yourself Steve!
Cheers Gary. I called across to Chris that the self-banning dimwit wishes her happy birthday. She called back, "Thanks. Great that he hit the right button this time."

Sorry about that. :cry: Couldn't resist. :lol:

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

Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Post by mobthehop »

too funny for words - happy birthday to Chris from my neck of the woods as well..... Luckily I have not earned any monikers yet.....

Mop
Lifesys
Trader
Posts: 126
Joined: Wed Apr 25, 2012 2:05 am
Location: Echuca Victoria. Australia

Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Post by Lifesys »

Happy birthday from Aus too Chris. Glad he gets to spend some time with you, not another coders widow!!
Steve I notice in BJS there are differing dimension references for TradePair array.
Declaration TradePair[][4] - (incl. 0th position), some [5] are in comments (lines 1082, 1087) and redundant Field list lines 983-4 , but line 313 has a live reference to TradePair[cc][6] re a GlobalVariable. Not sure why we do not get an 'index out of range' error?
garyfritz

Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Post by garyfritz »

Because MQL doesn't bother to check things like that. It just causes mysterious and hair-pulling errors when you access beyond the array bounds. (Guess how I know?? :roll:)

Good catch.
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 and Jem and Shelley's Pivot Basket auto-trader

Post by SteveHopwood »

Lifesys wrote:Happy birthday from Aus too Chris. Glad he gets to spend some time with you, not another coders widow!!
Oh, she is a coders widow, for sure. There are times when all she gets from me is a muffled grunt.
Steve I notice in BJS there are differing dimension references for TradePair array.
Declaration TradePair[][4] - (incl. 0th position), some [5] are in comments (lines 1082, 1087) and redundant Field list lines 983-4 , but line 313 has a live reference to TradePair[cc][6] re a GlobalVariable. Not sure why we do not get an 'index out of range' error?
The comments are left over from the conversion of ShelleyJem to BJS. They are not there to inform others, but to show me where the code block ends. The comments could contain a recipe, for all I care. You have to be inside my head to understand, but you really would not want that. :lol: Even so, I have corrected them for future coders and the changes will appear in the next update.

As Gary says, we do not get an 'index out of range' error because MQL4 is badly written. It did not create a problem because TradePair[cc][6] is never used again. I have removed the code block.

Cheers Pauls.

: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.
garyfritz

Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Post by garyfritz »

FYI, not using TradePair[cc][6] again is no guarantee it won't cause a problem. The EA assigned into that location -- and the value got written SOMEwhere. Depending on exactly how MQL is internally implemented and how memory is laid out, that can result in some other unrelated value changing mysteriously, or much worse. Out-of-bounds errors like that can cause horrific problems, which is why any proper language checks for them.
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 and Jem and Shelley's Pivot Basket auto-trader

Post by SteveHopwood »

garyfritz wrote:FYI, not using TradePair[cc][6] again is no guarantee it won't cause a problem. The EA assigned into that location -- and the value got written SOMEwhere. Depending on exactly how MQL is internally implemented and how memory is laid out, that can result in some other unrelated value changing mysteriously, or much worse. Out-of-bounds errors like that can cause horrific problems, which is why any proper language checks for them.
Thanks Gary.

Guys, I always defer to a Proper Programmer so V 1g is in post 1. Programmers do not come a lot properer than Gary, so I highly recommend this download.

: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.
feucht
Trader
Posts: 101
Joined: Thu May 03, 2012 3:16 pm

Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Post by feucht »

Seeing a weird problem with 1g (which I saw earlier today with 1d as well). If I try to open a position manually while BJS is active on another chart, my manual position is being immediately closed by BJS. BJS is set to use a Trade comment, which I am not using on the manual trade.

Anyone seen anything similar??
trader689
Trader
Posts: 674
Joined: Thu Nov 17, 2011 12:53 am

Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Post by trader689 »

im getting little to no activity on multiple demo accounts on this EA, ootb, allowadditionstobasket = true.

is this right? is this just a very infrequent trader?
Post Reply

Return to “10.x EA forum”