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

Bob and Shelley Again
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=2759
Page 34 of 120
Author:  SteveHopwood [ Fri Sep 27, 2013 8:44 pm ]
Post subject:  Re: Bob and Shelley Again

We have a couple of invaluable contributions from fxdaytrader. I will make the modified version of the code he published a few posts ago the post 1 version tomorrow. He has also been kind enough to update the UG, so I will replace mine with his also.

We still have a problem with the code for the stack basket trailing stop. Others here will have experienced this. Have a look at my GP demo trades - many duplicated on my live Cowboy IBFX play-money account closed trades today:
Noname.gif
You will see a couple of stack trades closed within a minute, yet at a profit. I assume the market was moving fast enough for the 'basket' of two trades to lock in a profit on both trades before closing.

So, is this a problem with the code, or with StackTrailingStopPips being too small, or both?

In terms of viewing this on our charts, there is bugger all we can do for now as the markets are closed for the weekends. On Monday I will try to force demo trades to replicate what is happening and see why. This is not always easy when it can take ages before a trade moves far enough to make adding a stack relevant, so it might take a while.

In the meantime, code bloop spotters please do your thingy. Remember what it was like spotting spelling mistakes in your essays at school? Never, ever saw them until they were pointed out, at which point they were blindingly obvious? Code bloops are like that.

:D
Author:  RxCape [ Fri Sep 27, 2013 8:58 pm ]
Post subject:  Re: Bob and Shelley Again

There is a snowball's chance in hell of me finding an error in your logic but I will go over it this weekend.

Tom
Author:  SteveHopwood [ Fri Sep 27, 2013 9:09 pm ]
Post subject:  Re: Bob and Shelley Again

RxCape wrote:There is a snowball's chance in hell of me finding an error in your logic but I will go over it this weekend.

Tom
Maybe, but I am kind-of a leader here, so most people enjoy spotting my bloops. I hope you can join in the fun. :lol:

:D
Author:  FXTrucker [ Sat Sep 28, 2013 2:48 pm ]
Post subject:  Re: Bob and Shelley Again

SteveHopwood wrote: You will see a couple of stack trades closed within a minute, yet at a profit. I assume the market was moving fast enough for the 'basket' of two trades to lock in a profit on both trades before closing.

So, is this a problem with the code, or with StackTrailingStopPips being too small, or both?

In the meantime, code bloop spotters please do your thingy. Remember what it was like spotting spelling mistakes in your essays at school? Never, ever saw them until they were pointed out, at which point they were blindingly obvious? Code bloops are like that.

:D
Hi -- I've developed an interest in BASA and will be starting a demo next week and will contribute to the thread when I think my comments can be useful.

Here is a M1 chart to see if the trade could have occurred on a US acct
gbpusdpro-m1-05-20a.png
So this indicates to me that since the movement was possible the first area to concentrate on is the StackTrailingStopPips being to small. In this case the trade closed out 10 pips below the bar high and 29.1 pips above the trades SL.

It looks like from your trade history that there were EURCAD and EURGBP trades open at the same time as the initial GBPUSD. It also looks like GBPUSD spiked by more than 50pips triggering this stack trade. It appears that this trade opened as intended then jumped to BE at +30pips and closed in profit 10 pips below the bar high all in the course of one minute at 5:20.

I have looked at the code on the version available on page 1 and don't find a problem with it at first glance. If I understand the code correctly, the OpenTrades variable is supposed to be the number of open trades for the pair the EA is managing not all open trades. So in this case it should have had a value of 2 not 4 (or more). With a value of 2 the trailing stop should have been 10pips if you used the default settings which the JBE stop and stack open trade history imply you did.

Hope this observation is useful. :geek:
Author:  SteveHopwood [ Sat Sep 28, 2013 3:41 pm ]
Post subject:  Re: Bob and Shelley Again

V 1z is in post 1.

Marc added the Friday close time thingy. He has also added some extra bits and bats to the general code that helps to tighten it further. Many thanks Marc.

From the updated UG:
  • Friday Trading Stop/Close all open trades. This is provided by Marc (fxdaytrader). Many thanks Marc.
    As well as at Trading hours the input is based on your local time, so use the 24 hour clock format and enter trading periods in your own local time. Forget broker server time and GMT offsets.
  • The parameters:
    • StopOpenPositionsFridayEvening If true, the EA will not open new positions after the hour specified in StopTradingLocalHour (integer only, to stop e.g. from 20:00 on just enter 20)
    • CloseAllOpenTradesAlso Will close the Eas open positions on friday, only works if StopOpenPositionsFridayEvening is true (should be dimwit-proof because some errorchecking takes also place). Closing takes place if time >= FridayCloseAllLocalHour (Current hour >= this, the EA will close every position (and every new position opened on the same day!))
    • StopTradingDay The day the market closes in your timezone (5=friday, 1=monday, 2=tuesday,..., 6=sunday), up to 99.9% you do not have to change that
    • DisableOnTesting Will disable the stop trading on friday/close all positions on friday-function when running the backtester


Tommaso pm'd with the suggestion that the problem with the rapid closing of the basket when the first stack trade arrives is because the default StackTrailingStopPips was too close, so I decided to spend the afternoon with the visual craptester. This showed Tommaso is spot on. We need a wider StackTrailingStopPips and it is dynamic by being multiplied by (no of open trades) rather than ((no of open trades - 1). Nice one, Tommaso.

BSAS looks increasingly promising. Even with the glitches, the GP demo is up 8%. The play money live account made 300 pips on Friday.

:D
Author:  SteveHopwood [ Sat Sep 28, 2013 5:13 pm ]
Post subject:  Re: Bob and Shelley Again

FxTrucker, thanks for looking. I posted mine before I read yours - it looks as though we have this sorted out.

:D
Author:  SteveHopwood [ Sat Sep 28, 2013 5:18 pm ]
Post subject:  Re: Bob and Shelley Again

I forgot to save the source code after changing the version number, so the 7 initial downloaders will have BASA still showing V 1y.

:D
Author:  SteveHopwood [ Sat Sep 28, 2013 5:40 pm ]
Post subject:  Re: Bob and Shelley Again

Updating Simple Bob, I found a few more unwanted instances of (OpenTrades - 1).

Redownload if you downloaded 1z before the time shown for this post.

:D
Author:  FXTrucker [ Sat Sep 28, 2013 8:05 pm ]
Post subject:  trailing stop ideas / observations

I wanted to include a chart of this trade and the main trade to show what happened Friday to help consider ideas for the trailing pip stop loss.
gbpusdpro-h1-stop ideas.png
The stack trade had already jumped to break even at plus 30 (so if I had BASA running on a US account it would set both main and stack trades to the same stack trade BE SL because of fifo rule). Both trades closed on the actual account at the same time even with different SL's .

The pair retraced to the point where it probably would have just triggered a break even stop loss set between the two stacked trades. In order to stay in the trade the EA would have to have been set to allow net loss on the two trades.

Since you feel that you want to eliminate loss after +30pips you might want to consider upping the stack trailing stop loss to 15pips which would give you 30pips on the first stack, 45 on the second (although JBE is still at 30) etc.
Author:  fxozgirl [ Sun Sep 29, 2013 9:43 pm ]
Post subject:  Re: Bob and Shelley Again

At the risk of copping a walloping for this time/day related question from Steve, FXDayTrader can you please clarify what settings are required for a Saturday close to trading. Down here in Oz, trading stops at 7am (AEST) Saturday morning...looks like this isn't accounted for in your settings

ie. Monday=1, Tuesday=2, I'm assuming Wednesday=3, Thursday=4, then Friday=5, Sunday=6

Apologies if I am being daft and remember it is Monday morning here ;)
StopTradingDay The day the market closes in your timezone (5=friday, 1=monday, 2=tuesday,..., 6=sunday), up to 99.9% you do not have to change that
All times are UTC Page 34 of 120