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

Bob and Jem and Shelley's Pivot Basket auto-trader
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=658
Page 11 of 28
Author:  phil_trade [ Thu Jul 05, 2012 4:56 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

garyfritz wrote:"invalid double number" !?

GlobalVariableSet is supposed to take a double. It will accept an int, and in fact the example in the online help uses Bars, which is an int.

But a runtime error of an "invalid" double? That sounds like a non-allowed value, such as NaN (Not a Number). But that seems pretty unlikely...
if found a post from ShelleyJEM EA with same error message
Getting this error on SJ 1h.

2012.06.12 08:38:52 ShelleyJem GBPJPYm,Daily: invalid double number as parameter 2 for GlobalVariableSet function
I found a way to have this message... set an integer negative number to GVset !
Author:  SteveHopwood [ Thu Jul 05, 2012 5:17 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

garyfritz wrote:
SteveHopwood wrote:I am not aware of GlobalVariableSet needing a double rather than an integer; indeed, I successfully send integer values to a GV all the time. I have made the change though - no particular reason not to.
The function definition specifies a double value; however MQL should automatically convert ints to doubles when you call it. But it's always a good idea to use the right type and not rely on the language to fix it up for you -- especially with a flaky language like MQL.
Cheers Gary.

:D
Author:  alex_forex [ Thu Jul 05, 2012 6:14 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

EA working pretty well on my demo VPS :)

Just a suggestion for the mail alert :
If 3 trades are sent by the EA running on a GBPJPY chart, we receive 3 mails
with GBPJPY Buy trade or Sell trade instead of "Traded pair" Buy or Sell
:geek:


Kind regards :D
Alex
Author:  garyfritz [ Thu Jul 05, 2012 6:29 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

I'm a little unclear on exactly how to run this beastie. Do you look once a day, set the PairsToTrade input to the promising pairs for the day (because they have slope > 0.6 and they're currently in pullbacks), and turn it loose to run that basket? Or do you set PairsToTrade to all pairs you'd be willing to trade, and then the EA looks for any opportunities at any time?

I thought it was the former (manually set it up for baskets) because of the MinimumPercentOfBasket input. I thought that meant "I listed 10 pairs in PairsToTrade, and MinimumPercentOfBasket is 50, so it won't fire until at least 5 pairs trigger. Then it will launch the whole basket." But after running for over 18 hours, it just entered 2 positions (AUDUSD & NZDUSD) a few minutes ago, so apparently it's a set-and-forget?

I had 10 pairs in my PairsToTrade, and MinimumPercentOfBasket is 50, so I'm not sure why it opened 2 positions...
Author:  spyderman [ Thu Jul 05, 2012 7:11 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

garyfritz wrote:I'm a little unclear on exactly how to run this beastie. Do you look once a day, set the PairsToTrade input to the promising pairs for the day (because they have slope > 0.6 and they're currently in pullbacks), and turn it loose to run that basket? Or do you set PairsToTrade to all pairs you'd be willing to trade, and then the EA looks for any opportunities at any time?

I thought it was the former (manually set it up for baskets) because of the MinimumPercentOfBasket input. I thought that meant "I listed 10 pairs in PairsToTrade, and MinimumPercentOfBasket is 50, so it won't fire until at least 5 pairs trigger. Then it will launch the whole basket." But after running for over 18 hours, it just entered 2 positions (AUDUSD & NZDUSD) a few minutes ago, so apparently it's a set-and-forget?

I had 10 pairs in my PairsToTrade, and MinimumPercentOfBasket is 50, so I'm not sure why it opened 2 positions...
Gary
I think you put all pairs in the ea It lists pairs that meet slope criteria on screen
Then when your selected percent of trades trigger it will launch the basket
Author:  getting [ Thu Jul 05, 2012 8:12 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

garyfritz wrote:I'm not sure why it opened 2 positions...
give version 1e(49.73 KiB) a try, with EndlessLoop=false & AllowAdditionsToBasket=false
Author:  SteveHopwood [ Thu Jul 05, 2012 8:31 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

garyfritz wrote:Or do you set PairsToTrade to all pairs you'd be willing to trade, and then the EA looks for any opportunities at any time?
Yes.

I thought it was the former (manually set it up for baskets) because of the MinimumPercentOfBasket input. I thought that meant "I listed 10 pairs in PairsToTrade, and MinimumPercentOfBasket is 50, so it won't fire until at least 5 pairs trigger. Then it will launch the whole basket." But after running for over 18 hours, it just entered 2 positions (AUDUSD & NZDUSD) a few minutes ago, so apparently it's a set-and-forget?
I had 10 pairs in my PairsToTrade, and MinimumPercentOfBasket is 50, so I'm not sure why it opened 2 positions...
Posts like yours from someone like you always send me to look at post 1, in the hope that I can say something along the lines of, "Aye aye, yet another yahoo incapable of reading post 1."

Sadly, yet again it is mea culpa. Hey ho. There is always that, um, recent incident I am trying hard not to mention here................ :lol:

I have amended post 1. This should answer your query Gary. Sing out if not:

"- AllowAdditionsToBasket: this allows bjs to add fresh trades to the basket as they are triggered by a retrace beyond, then cross back over the daily pivot. The effect of this is to override MinimumPercentOfBasket and allow bjs to build baskets trade-by-trade rather than as all-in-at-once."

:D
Author:  SteveHopwood [ Thu Jul 05, 2012 8:37 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

alex_forex wrote:EA working pretty well on my demo VPS :)

Just a suggestion for the mail alert :
If 3 trades are sent by the EA running on a GBPJPY chart, we receive 3 mails
with GBPJPY Buy trade or Sell trade instead of "Traded pair" Buy or Sell
:geek:


Kind regards :D
Alex
Thanks Alex. This is because I did not adapt the generic code I copied for the function, so it sends Symbol() rather than symbol, which is a variable that holds the pair actually being traded. I will fix this in the next update.

:D
Author:  alex_forex [ Thu Jul 05, 2012 8:39 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Thanks Steve ;-)
I like so much receive good news in my mailbox :lol:
Author:  SteveHopwood [ Thu Jul 05, 2012 9:22 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Version 1f is in post 1. Possibly.

Be warned gals and galesses, this one comes with a Severe Steve Is Sloshed Warning.

It is Chris's (wifey's) birthday today, so we have been imbibing. Quite a lot.

So, anyone with a remaining sober brain cell is best off checking my code before unleashing it onto some poor, unsuspecting demo.
  • 1) fixed the Alert thingy that Alex brought up.
    2) added code to set up a Global Variable that tells bjs that the silly sod should be sleeping if some other equally silly sod is daft enough to awake him during a post successful basket closure snooze.
Given my current state, it will be not a lot short of a miracle if 2 actually works.

Hic.

:D
All times are UTC Page 11 of 28