| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Peaky Fifo https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5203 |
Page 1 of 13 |
| Author: | gprince66 [ Fri Jun 23, 2017 6:51 pm ] |
| Post subject: | Peaky Fifo |
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 . |
|
| Author: | SteveHopwood [ Fri Jun 23, 2017 10:59 pm ] |
| Post subject: | 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. |
|
| Author: | cozybooks [ Sat Jun 24, 2017 12:23 am ] |
| Post subject: | 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! |
|
| Author: | gprince66 [ Sat Jun 24, 2017 2:22 am ] |
| Post subject: | Peaky Fifo |
Thanks cozy, looking forward to your feedback. US Members, there is a new version in post 1 with an important code change. Have a great weekend, Gary |
|
| Author: | gprince66 [ Sun Jun 25, 2017 5:30 pm ] |
| Post subject: | Peaky Fifo |
Version 1.1 with important logic blunder fixed is now available in post #1. I misunderstood 'Patience' Up next, add code to take advantage of Oanda and 'adjust stop orders by MODE_LOTSTEP'. |
|
| Author: | SteveHopwood [ Sun Jun 25, 2017 6:00 pm ] |
| Post subject: | 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? |
|
| Author: | gprince66 [ Sun Jun 25, 2017 7:10 pm ] |
| Post subject: | 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. 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 |
|
| Author: | gprince66 [ Sun Jun 25, 2017 7:28 pm ] |
| Post subject: | 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! |
|
| Author: | gprince66 [ Sun Jun 25, 2017 8:11 pm ] |
| Post subject: | 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 |
|
| Author: | cozybooks [ Sun Jun 25, 2017 10:50 pm ] |
| Post subject: | 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! |
|
| All times are UTC | Page 1 of 13 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|