Before using Peaky_Fifo, read Steve's post explaning how to trade this EA:
http://www.stevehopwoodforex.com/phpBB3 ... 79#p153767
Hi Fellow US Members,
Thanks to Steve's brilliance we have another amazing tool to add to our trading arsenal. Unfortunately, we have to follow the absurd fifo rules. Because of this, most of Steve's EAs simply won't trade properly for us. But now, thanks to Peaky we can join in on the fun.
I made a few edits and added some 'fifo code' to Peaky and she performs beautifully, even under complete fifo compliance (tests currently under way at Oanda and Forex.com).
The logic ended up being quite simple, if only 1 pending is open, we can modify that order to follow along when the market makes new highs or lows. If 1 market order is open or 2+ pending, we have to lump together the take profit values and halt further order modications.
Due to fifo rules, we have to use the 'hidden take profit' line to help manage trade closures. I have the default 'PipsHiddenFromCriminal' set to 10, and it works fine on M15. Twenty worked great on H1. The hidden take profit line guards against price hitting a 'broker hard' TP, God forbid that 'TP line's' trade ticket is out of 'fifo order'.
I threw this together last night so any ideas or suggestions are more than welcome. I need to stress that this version has only been tested for one night on demo accounts, so put it through the ringer before using on real account.
Green pips to all,
Gary
6-23-17 Edit:
New version with important code fixes
6-25-17 Edit:
version 1.1 with a logic fix.
7-5-17:
added option to vary lot amount to avoid fifo
7-6-17
bug fix
.
Peaky Fifo
- gprince66
- Trader
- Posts: 73
- Joined: Tue Jan 12, 2016 7:15 am
- Location: Austin, TX USA
Peaky Fifo
You do not have the required permissions to view the files attached to this post.
Last edited by gprince66 on Thu Jul 06, 2017 9:43 pm, edited 4 times in total.
- SteveHopwood
- Owner
- Posts: 9754
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Peaky Fifo
Fantastic stuff Gary.
It will be a joy to add this to my wrup on Sunday.
Off to point US members to it in my Peaky thread.
It will be a joy to add this to my wrup on Sunday.
Off to point US members to it in my Peaky thread.
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. [email protected] 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.
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. [email protected] 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.
- cozybooks
- Trader
- Posts: 299
- Joined: Wed Mar 27, 2013 1:33 am
Peaky Fifo
Oh Gary, you and Steve are just all time superstars!
Can't wait to try it out. I have live accounts on both Oanda and Forex.com, so this is just the ticket.
The day I stumbled upon Steve's forum is still the luckiest day in my Forex life!
Can't wait to try it out. I have live accounts on both Oanda and Forex.com, so this is just the ticket.
The day I stumbled upon Steve's forum is still the luckiest day in my Forex life!
- gprince66
- Trader
- Posts: 73
- Joined: Tue Jan 12, 2016 7:15 am
- Location: Austin, TX USA
Peaky Fifo
Thanks cozy, looking forward to your feedback. :hi:
US Members, there is a new version in post 1 with an important code change.
Have a great weekend,
Gary
US Members, there is a new version in post 1 with an important code change.
Have a great weekend,
Gary
- gprince66
- Trader
- Posts: 73
- Joined: Tue Jan 12, 2016 7:15 am
- Location: Austin, TX USA
Peaky Fifo
Version 1.1 with important logic blunder fixed is now available in post #1.
I misunderstood 'Patience' and took away Peaky_Fifo's ability to close trades on an opposite PH & Sixths signal. Steve's original logic is back and working properly.
Up next, add code to take advantage of Oanda and 'adjust stop orders by MODE_LOTSTEP'.
I misunderstood 'Patience' and took away Peaky_Fifo's ability to close trades on an opposite PH & Sixths signal. Steve's original logic is back and working properly.
Up next, add code to take advantage of Oanda and 'adjust stop orders by MODE_LOTSTEP'.
- SteveHopwood
- Owner
- Posts: 9754
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Peaky Fifo
Gary, how does FIFO affect this scenario: there is an older trade with a 200 pip TP; same pair but a younger trade has a 20 pip TP that is reached. What happens?
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. [email protected] 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.
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. [email protected] 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.
- gprince66
- Trader
- Posts: 73
- Joined: Tue Jan 12, 2016 7:15 am
- Location: Austin, TX USA
Peaky Fifo
It will not let you close this younger trade because the older trade is first in the 'fifo order by OrderOpenTime(), not ticket number'. A 'fifo error' will be sent.SteveHopwood wrote:Gary, how does FIFO affect this scenario: there is an older trade with a 200 pip TP; same pair but a younger trade has a 20 pip TP that is reached. What happens?
But according to cozybooks, if trading with Oanda and each of these orders have different lot sizes, the younger trade would close. The more I think about this, the more questions I have on how to implement this.
I plan to run it through the ringer with Oanda Demo when markets open in a bit.
Hope this helps,
Gary
- gprince66
- Trader
- Posts: 73
- Joined: Tue Jan 12, 2016 7:15 am
- Location: Austin, TX USA
Peaky Fifo
Here's a link to Oanda's Fifo rules. Even though they say you can sort fifo by ticket, I had to write a function to group trades by OrderOpenTime(), then loop each group until they close, then move on the next OrderOpenTime() group. This was happening when I sent a tight grid.
https://www.oanda.com/resources/legal/u ... rades-fifo
Fifo really sucks!
https://www.oanda.com/resources/legal/u ... rades-fifo
Fifo really sucks!
- gprince66
- Trader
- Posts: 73
- Joined: Tue Jan 12, 2016 7:15 am
- Location: Austin, TX USA
Peaky Fifo
Here is a link to my Fifo 'close all trades' scripts if anyone is interested. There is a 'close all trades this pair' and a 'nuclear option' script.
http://www.stevehopwoodforex.com/phpBB3 ... 07#p154397
Gary
http://www.stevehopwoodforex.com/phpBB3 ... 07#p154397
Gary
- cozybooks
- Trader
- Posts: 299
- Joined: Wed Mar 27, 2013 1:33 am
Peaky Fifo
Gary, thanks! I will keep up with the latest versions as you release them and try them out. The speed at which you and Steve work is absolutely stunning!