Holy Graily Bob 'n Dotty

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
Post Reply
User avatar
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

Holy Graily Bob 'n Dotty

Post by Wavegarrick »

Hi Guys.

Early days and thanks Steve for this. I have started tests today, the concept is great :good: Will report back on my tests.

Cheers
Leon
kennychua
Posts: 7
Joined: Sat Feb 27, 2016 6:12 am

Holy Graily Bob 'n Dotty

Post by kennychua »

Hi Steve

I believe the following code in LookForTradeClosure function from line 3586 to 3591 is not necessary

Code: Select all

      //Can we close a hedge trade? We will want to close it if there
      //is an opposite direction Trend signal and it is in profit.
      if (OrderComment() == FullHedgeComment)
         if (LongTrendDetected)
            if (!OnlyCloseFullHedgeWhenInProfit || (OrderProfit() + OrderSwap() + OrderCommission()) > 0)
               CloseThisTrade = true;
Because this is handled in LookForFullHedgeTradeClosure function.

Anyway, it doesn't affect the logic of the program as the LookForTradeClosure function doesn't trigger if position is hedged.
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.

Holy Graily Bob 'n Dotty

Post by SteveHopwood »

Wavegarrick » Thu Feb 16, 2017 4:03 pm wrote:Hi Guys.

Early days and thanks Steve for this. I have started tests today, the concept is great :good: Will report back on my tests.

Cheers
Leon
Brilliant Leon. There is a lot more coming over the next week or so.

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

Holy Graily Bob 'n Dotty

Post by SteveHopwood »

kennychua » Fri Feb 17, 2017 3:03 am wrote:Hi Steve

I believe the following code in LookForTradeClosure function from line 3586 to 3591 is not necessary

Code: Select all

      //Can we close a hedge trade? We will want to close it if there
      //is an opposite direction Trend signal and it is in profit.
      if (OrderComment() == FullHedgeComment)
         if (LongTrendDetected)
            if (!OnlyCloseFullHedgeWhenInProfit || (OrderProfit() + OrderSwap() + OrderCommission()) > 0)
               CloseThisTrade = true;
Because this is handled in LookForFullHedgeTradeClosure function.

Anyway, it doesn't affect the logic of the program as the LookForTradeClosure function doesn't trigger if position is hedged.
Dead right on both counts. :clap: :clap: :clap:

It is one of the thingies I noticed when recoding HGBnDnSS and I removed the snippet from the shell. That this snippet only appeared in one of the conditionals suggests that I intended removing it a long time ago and only remembered to remove one of them. I have not bothered updating V1 here because it makes no difference.

:xm:
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
Wavegarrick
Trader
Posts: 1172
Joined: Sun Dec 30, 2012 11:21 am
Location: South Africa

Holy Graily Bob 'n Dotty

Post by Wavegarrick »

SteveHopwood wrote:Brilliant Leon. There is a lot more coming over the next week or so.
Please do take your time Steve. I believe we are heading in the right direction. Looking forward to the upcoming additions ;)

Cheers
Leon
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.

Holy Graily Bob 'n Dotty

Post by SteveHopwood »

A member posted this in the Basics thread:
Has anyone else had trouble getting Holy Graily Bob 'n Dotty to work on the latest version("Version 1")?
I placed the EA on a charrt(GBPJPY) on 16th Feb with OOTB settings and have seen no activity at all since.
I know that this may be too short a time for any trades to have been placed, but I had the same trouble all thru Late January and February on the previous version, which had been working fine before.

I know craptester is frowned on here, but I tried to run "Version 1" on a backtest of 3 months just to see if any thing would happen.
Nothing at all.
I ran Holy Graily Bob 'n Dotty 'n Bolly on the same period /data and it does take trades.

I have checked that allow live trades are set correctly.
I have taken te EA off the chart, recompiled and reset it.
The bot does have a smily face and displays data such as in a long trend etc, but no trades.
I found this bot to be exceptionally good, but over the last few months seems to have jut stopped working.
I do have Super CSS V2.2 running on the charts if that makes any difference.

Thanks for any help you can give me
I think this is worth discussing here.

The markets do not spend a lot of time in the top and bottom sixths. Using the sixths filter will cut trading no close to zero. Should be damn good ones when they do happen. :party: I have run a couple of sixths enabled and buy low sell high craptests to check out the code and it appears to be sticking somewhere. It looks as though there is an endless loop somewhere in the mix; no doubt we will find it once we do get some trades.

I had some nice CADJPY sells on Friday on a demo with sixths disabled and using buy low sell high instead of sixths. Four pendings filled and the position closed at +40 - not sure why but that is another matter. These trades were nicely in the top half of the chart and I am speculating that having both the latest filters enabled but with ChartDivisor set to 2 so we only sell in the top half of the chart and buy in the bottom. We shall see.

:xm:
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.
pakeha
Trader
Posts: 78
Joined: Tue Nov 06, 2012 3:20 am
Location: Canada

Holy Graily Bob 'n Dotty

Post by pakeha »

Steve

I have been finding the same thing, using sixths, quarters and halves in price moves that should have triggered a trade (I had the trend and trading timeframes set up on different charts with the same broker) on the Empty4 strategy tester (note: I wasn't trying to do a "backtest" but rather just monitor the dynamic of the trade). I have used quarters (quartiles) in my trading in the past so am quite familiar with the technique.

It could be the strategy tester, or it could be the code - not sure.

Others may have been more successful.
kennychua
Posts: 7
Joined: Sat Feb 27, 2016 6:12 am

Holy Graily Bob 'n Dotty

Post by kennychua »

I have HGBnDB with the Sixth function on real since it was released.

I have made modifications to my code to remove the use of HGI. There is nothing wrong with HGI, it is just personally I do not run an EA with codes I cannot read (source code). I also added my own code for debugging the EA.

In very unique circumstances, the Sixth function does not work correctly. Also it definitely doesn't work in the tester. Not using Sixth or the BuyLowSellHigh solve the problem. But for me, without the HGI indicator, my EA is prone to make a lot of trade, and therefore the Sixth functionality is very helpful.

I have been trying the whole night to pinpoint the cause and how to remedy it and after I slept on it I had some idea on possible solutions. I just need to test it properly first and that take some times now that the market is closed.
kennychua
Posts: 7
Joined: Sat Feb 27, 2016 6:12 am

Holy Graily Bob 'n Dotty

Post by kennychua »

Hi Steve

I have done some debugging and I am quite confident that the following line of code inside GetSixth doesn't work as expected.

The first one:

Code: Select all

per = ChartPeriod(TradingTimeFrame);//Save the current chart
The per is always zero because ChartPeriod function parameter is suppose to be the ChartID of the chart we wish to obtain the period for. As it cannot find a Chart with the ID of TradingTimeFrame, the function return 0 and per is always set to 0.

If we wish to save the current chart period, the code should be.

Code: Select all

per = ChartPeriod(0)
ChartID of 0 refer to the current chart.


The second one:

Code: Select all

ChartSetSymbolPeriod(0, Symbol(), nextPer);//Change time frame
ChartSetSymbolPeriod(0, Symbol(), per);//reset time frame
As I understand it, the purpose of this is to change the chart to a different timeframe (any of them will do) and then back to the one we want, so that we have a clean accurate display of the chart "before" we calculate the value for Sixth.

Although this is similar to how one may manually change to a different timeframe by clicking on it with the mouse, and then changing back to our original timeframe, as a way of reloading the chart, it doesn't really work that way when used for coding because of one big difference:

Changing the chart by code - Doesn't actually change it, because the next line of code continue to execute without waiting for the "lag or delay in changing the chart period".
Changing it manually - Does actually change it, as the chart will lag, and we will wait before doing anything.

The ChartSetSymbolPeriod only place a queue in the chart event for the chart symbol and period to be changed. It doesn't actually force or make sure the chart is change, before executing the next line of code. The queue may be slow or fast to execute depending on many factors out of our control, including the number of chart the user is running Dottybot on and the number of indicator on the chart.

Therefore, the next line of code, may execute before the chart is changed or may execute after the chart is change. There is really no way to tell. Furthermore when the chart is changed, the EA would run OnDeinit and OnInit again and also reload any other indicator used by the EA or loaded on the chart. I believe this is also the cause for the Sixth line not showing properly and requiring a recompilation of the code to force a reload.

I have coded a workaround that doesn't require ChartSetSymbolPeriod. I compare the value of the trading timeframe peak and higher timeframe peak from the workaround with the existing "version 1" loaded in another terminal and it have exactly the same value, except some.

Some of the chart have different current peak high or current peak low (either one of them) with the workaround. I believe the discrepancy is that the existing one doesn't calculate the Sixth value correctly sometime when ChartSetSymbolPeriod didn't change the chart fast enough before the next line of code in the EA start executing.

This is because the existing version 1 is showing the current peak high or low in the middle of the chart, while the workaround is showing it at top and bottom of the chart.

I will be waiting for the market open to test the workaround and see how reliable it is.
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.

Holy Graily Bob 'n Dotty

Post by SteveHopwood »

I am completely rewriting the code, which does not work as I hoped and is not necessary.

:xm:
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 “Thingy Bob EA's”