Flying Slope auto-trading EA

Post Reply
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: Flying Slope auto-trading EA

Post by SteveHopwood »

Version 1i is in post 1.

If you enable CloseOnHtfSignal, you are telling FS to close a buy trade if there is a down arrow on the higher time frame chart (vice-versa for a sell). You need a value in the HigherTimeFrame Flying Buddha inputs section. To stop FS from using the Htf FB as part of the trading decision, set UseHigherTimeFrame to false.

Getting this right has been a struggle this afternoon, but it appears to be holding up in strategy tester.

: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.
kwchau
Trader
Posts: 305
Joined: Tue Jan 03, 2012 3:37 pm

Re: Flying Slope auto-trading EA

Post by kwchau »

SteveHopwood wrote:Version 1i is in post 1.

If you enable CloseOnHtfSignal, you are telling FS to close a buy trade if there is a down arrow on the higher time frame chart (vice-versa for a sell). You need a value in the HigherTimeFrame Flying Buddha inputs section. To stop FS from using the Htf FB as part of the trading decision, set UseHigherTimeFrame to false.

Getting this right has been a struggle this afternoon, but it appears to be holding up in strategy tester.

:D
Thanks for the quick update, will put it into test with both CloseonHtfSignal and UseHighertimeFrame to false.
jiaxingx
Trader
Posts: 43
Joined: Fri Jun 22, 2012 10:45 am

Re: Flying Slope auto-trading EA

Post by jiaxingx »

anybody backtest that ea 1i ?
I have no trade !
Image
kwchau
Trader
Posts: 305
Joined: Tue Jan 03, 2012 3:37 pm

Re: Flying Slope auto-trading EA

Post by kwchau »

jiaxingx wrote:anybody backtest that ea 1i ?
I have no trade !
I have 2 trades opened on demo, gpbaud and usdcad.
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: Flying Slope auto-trading EA

Post by SteveHopwood »

Version 1j is in post 1. Details in 'Rogue' trades and the safety features in post 1.

This is an essential update. I cannot guarantee that the sort of combination of inputs and incorrect coding logic that kwchau highlighted last week might not occur again - if I could so guarantee would imply that I can forsee every possible combination. I cannot. To continue to use an older version of FS is foolish.

That is the polite version, and I find some people resistant to stuff expressed quietly, so here it is a tad more directly.

Only an idiot would continue to use an older version of FS after the events of last week. If you are one-such idiot, then do not come crying to me when FS drains your account. You will not receive any sympathy.

: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
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: Flying Slope auto-trading EA

Post by SteveHopwood »

Re the sparse trading, this is to be expected. Anyone who understands what a Flying Buddha is and has more than a tenuous grasp of what Slope is telling us, will understand that it is not going to be a trading tart - and will understand why. Plus, it is August.

I also have the gbpaud trade on my live account - and it is going nowhere. I do not mind, because the swap is positive. I would be going nuts were it negative. :lol: If the trade does head South as some stage, then great. If not, and it either stays put or heads North, then I will simply treat it as a carry trade and let it earn interest.

: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.
pah
Posts: 6
Joined: Sat Jan 07, 2012 7:25 am

Re: Flying Slope auto-trading EA

Post by pah »

Hi Steve,

Just downloaded this one (1J) out of interest and noticed that it freezes the tester as soon as it opens the first trade (a sell in my case). I'm still looking for possible causes.

I did notice that there is a bug in IsClosedTradeRogue()

Code: Select all

      //Subtract the OrderCloseTime from the OrderOpenTime. There must be a minimum of > MinMinutesBetweenTradeOpenClose minutes between the open and the close. < this indicates possible rogue behaviour.
      if (OrderOpenTime() - OrderCloseTime() < (MinMinutesBetweenTradeOpenClose * 60) )
I think what you wanted to check was OrderCloseTime() - OrderOpenTime()

Also, the break following the test means that once you have found and checked one history trade (with matching magic no, etc) and it's open & close times were OK, then it can exit the loop. However, this assumes that the history trade you found was the very last one closed which may not always be the case since the order of trades is arbitary. Remember a good while back when I sent you some history checking code (it was to find the last closed order) for something that was exhibiting strange behaviour which was down to this issue?

Regards, Paul.
pah
Posts: 6
Joined: Sat Jan 07, 2012 7:25 am

Re: Flying Slope auto-trading EA

Post by pah »

The freeze on opening a trade appears to be fixed by adding a return value to the following two lines in LookForTradeClosure()

Code: Select all

if (HtfSlopeTrend == buyhold) return(false);

Code: Select all

if (HtfSlopeTrend == sellhold) return(false);
Regards, Paul.
pah
Posts: 6
Joined: Sat Jan 07, 2012 7:25 am

Re: Flying Slope auto-trading EA

Post by pah »

And now it only trades once which is caused by the check in TooClose()

Code: Select all

if (TimeHour(TimeCurrent()) - TimeHour(OrderCloseTime()) < (MinMinutesBetweenTrades * 60) )
This is checking the hour but could be checking a trade from yesterday for example, which happened to have occurred at an earlier hour.

Also, I'm a bit puzzled by it only checking history here, should it not also be looking at open trades that were taken recently and ensuring it doesn't open another too soon after?

Since it only opens market orders direct (no stop or limit orders) might it not be easier to set a datetime variable called e.g. NextTradeAllowed which you can set when you open a trade ( TimeCurrent() + (MinMinutesBetweenTrades * 60) ) and then disallow any subsequent trades that fire before this time has passed?

Just my thoughts...

Regards, Paul.
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: Flying Slope auto-trading EA

Post by SteveHopwood »

pah wrote:Hi Steve,

Just downloaded this one (1J) out of interest and noticed that it freezes the tester as soon as it opens the first trade (a sell in my case). I'm still looking for possible causes.

I did notice that there is a bug in IsClosedTradeRogue()

Code: Select all

      //Subtract the OrderCloseTime from the OrderOpenTime. There must be a minimum of > MinMinutesBetweenTradeOpenClose minutes between the open and the close. < this indicates possible rogue behaviour.
      if (OrderOpenTime() - OrderCloseTime() < (MinMinutesBetweenTradeOpenClose * 60) )
I think what you wanted to check was OrderCloseTime() - OrderOpenTime()
Nope. The order opened before it closed, so I need to know how soon after its open that it closed.
Also, the break following the test means that once you have found and checked one history trade (with matching magic no, etc) and it's open & close times were OK, then it can exit the loop. However, this assumes that the history trade you found was the very last one closed which may not always be the case since the order of trades is arbitary. Remember a good while back when I sent you some history checking code (it was to find the last closed order) for something that was exhibiting strange behaviour which was down to this issue?

Regards, Paul.
Can you do me a favour, please, and resend me this, or post it here? I don't remember this and it would be most helpful.

: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.
Post Reply

Return to “Automated trading systems”