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 9 of 28
Author:  Armen [ Thu Jul 05, 2012 8:31 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Hi Phil, mine is 0.9839
AUDCHF is in BUY mode BJSPB
Author:  harry45 [ Thu Jul 05, 2012 8:36 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

phil_trade wrote:Hi Steve

as I experience freeze reading indicator with BJSPB, I cut the loop in start() for debug purpose only and adapt snoozed() to run visual test.

First, I found an error with GlobalVariableSet which need Double parameter but JslCash was Integer.

Second, I wonder if this loop in start() with "static datetime OldM1BarTime" define thousand time is not the problem some of us encountered, depending on windows version, memory amount and so on.

So I modify code and add the last time read indicator in display module so I can trace it. As BJSPB is not a scalp EA, may be we can avoid this loop and let chart tick call Start(). Using a high frequency tick pair as EURUSD could do the job.

I have mark this code version with //PHIL before each modification, so you can retreive them.

For those who experience this freeze read indicator problem, you can run this test version and trace the last Time reas indicator just under the version Number.

Hope this will help !

Philippe
Working fine,open 2 trades -EA-sell,ACHF-buy Daily Pivot0.98376(Cowboy Go Markets-NL).
Thank You
Author:  KingOfCoolville [ Thu Jul 05, 2012 8:50 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Phil_Trade, just loaded your version of the EA up on my Alpari demo account. It is refreshing every minute.

When I load Steve's version on exactly the same system/account it loads initially but does not refresh.

The issues that Phil_Trade has highlighted seem to be the answer to the problem for the users that seem to have problems with the original EA not refreshing.
Author:  Armen [ Thu Jul 05, 2012 9:04 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

I am running Cowboy IBFX Empty4 built 419 on HP mini - the BJS v1B refreshes.
I have 10.2 indis (not 10.2A) on my charts.
Author:  Armen [ Thu Jul 05, 2012 9:27 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

I see A/F and E/A stall at previous H1 fractal. Closed all trades manually for some +56 pips.
Will wait for EUR zone Minimum Bid Rate and US ADP Non-Farm Employment Change figures.
Author:  phil_trade [ Thu Jul 05, 2012 9:31 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Armen wrote:I am running Cowboy IBFX Empty4 built 419 on HP mini - the BJS v1B refreshes.
I have 10.2 indis (not 10.2A) on my charts.
mmm, I'm running Empty4 build 432...may be we have to check this

please, every one who experience this freeze problem, check and post your Empty4 version
Author:  SteveHopwood [ Thu Jul 05, 2012 9:31 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

phil_trade wrote:Hi Steve

as I experience freeze reading indicator with BJSPB, I cut the loop in start() for debug purpose only and adapt snoozed() to run visual test.

First, I found an error with GlobalVariableSet which need Double parameter but JslCash was Integer.

Second, I wonder if this loop in start() with "static datetime OldM1BarTime" define thousand time is not the problem some of us encountered, depending on windows version, memory amount and so on.

So I modify code and add the last time read indicator in display module so I can trace it. As BJSPB is not a scalp EA, may be we can avoid this loop and let chart tick call Start(). Using a high frequency tick pair as EURUSD could do the job.

I have mark this code version with //PHIL before each modification, so you can retreive them.

For those who experience this freeze read indicator problem, you can run this test version and trace the last Time reas indicator just under the version Number.

Hope this will help !

Philippe
Cheers Philippe.

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.

Version 1c is in post 1. I copy this from the edit to the post as an explanation:
- EndlessLoop: you will find the profit level of a large basket of trades changes rapidly, and it is desirable to have this calculated more often than by waiting for the next tick on the chart hosting bjs. To achieve this, bjs goes into an endless loop that checks the position twice a second. It turns out that this causes an EA freeze on some machines, so EndlessLoop allows you to cancel this feature. If your EA does not read the table once a minute, then set EndlessLoop to false.

This reminded me to do something about those non-stop alerts that someone mentioned at the start of the week, so I have added code that I think stops this, but am not sure that this does not kill the Alert thingy stone dead. See how it goes, but I might need to rethink this; it is far more complicated that non-coders might imagine.

:D
Author:  phil_trade [ Thu Jul 05, 2012 9:58 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

SteveHopwood wrote:
phil_trade wrote:Hi Steve

as I experience freeze reading indicator with BJSPB, I cut the loop in start() for debug purpose only and adapt snoozed() to run visual test.

First, I found an error with GlobalVariableSet which need Double parameter but JslCash was Integer.

Second, I wonder if this loop in start() with "static datetime OldM1BarTime" define thousand time is not the problem some of us encountered, depending on windows version, memory amount and so on.

So I modify code and add the last time read indicator in display module so I can trace it. As BJSPB is not a scalp EA, may be we can avoid this loop and let chart tick call Start(). Using a high frequency tick pair as EURUSD could do the job.

I have mark this code version with //PHIL before each modification, so you can retreive them.

For those who experience this freeze read indicator problem, you can run this test version and trace the last Time reas indicator just under the version Number.

Hope this will help !

Philippe
Cheers Philippe.

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.

Version 1c is in post 1. I copy this from the edit to the post as an explanation:
- EndlessLoop: you will find the profit level of a large basket of trades changes rapidly, and it is desirable to have this calculated more often than by waiting for the next tick on the chart hosting bjs. To achieve this, bjs goes into an endless loop that checks the position twice a second. It turns out that this causes an EA freeze on some machines, so EndlessLoop allows you to cancel this feature. If your EA does not read the table once a minute, then set EndlessLoop to false.

This reminded me to do something about those non-stop alerts that someone mentioned at the start of the week, so I have added code that I think stops this, but am not sure that this does not kill the Alert thingy stone dead. See how it goes, but I might need to rethink this; it is far more complicated that non-coders might imagine.

:D
ooppss... no start() anymore if endlessloop = false !
if (!EndlessLoop) x = 2;//Turns off the loop for those whose ea freezes when using this

while(x == 0)//Start an endless loop
{
you need to move the line at the end of start()

Code: Select all

      Sleep(500);//Half a second
      
      if (!EndlessLoop) x = 2;//Turns off the loop for those whose ea freezes when using this
      
   }//while(x == 0)
Author:  SteveHopwood [ Thu Jul 05, 2012 10:46 am ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

phil_trade wrote:
ooppss... no start() anymore if endlessloop = false !
if (!EndlessLoop) x = 2;//Turns off the loop for those whose ea freezes when using this

while(x == 0)//Start an endless loop
{
you need to move the line at the end of start()

Code: Select all

      Sleep(500);//Half a second
      
      if (!EndlessLoop) x = 2;//Turns off the loop for those whose ea freezes when using this
      
   }//while(x == 0)
Good thing one of us has a firing brain-cell. :lol:

1d in post 1. I also remembered to move that static datetime declaration out of the loop.

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

Steve - you know my MQL coding "skills" are limited so feel free to treat with disdain :lol:

Anyway - there seems to be an issue with BJS when a successful basket is hit and the EA sleeps for whatever time specified (1 minute in my case) when endlessloop = false. What then happens is that BJS opens another basket (as it should if qualified) and then instantly closes it. I "suspect" that it is because the global variables are not being deleted so BJS thinks we have hit our profit target and closes the basket:

Code: Select all

int OldOpenTrades = OpenTrades;
	  CountOpenTrades();
      if (OpenTrades == 0)
      {
         BreakevenAchieved = false;
         GlobalVariableDel(PipsTpGvName);
         GlobalVariableDel(CashTpGvName);
         CloseNeeded = false;
         JslPips = 0;
         JumpingStopPips = 0;
      }//if (OpenTrades == 0)
Is in the endless loop.
All times are UTC Page 9 of 28