| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Once Upon A Timeframe https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3685 |
Page 1 of 8 |
| Author: | Radar [ Mon Jun 16, 2014 3:57 pm ] |
| Post subject: | Once Upon A Timeframe |
SERIOUS WARNING Most Forex traders lose all their money. Using the robot posted here in trading Forex does not guarantee success. Trading this robot could lead to serious financial loss. Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money. This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention. At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot. To trade this robot, you have to understand: How to use EA's. The concept of basket trading. THIS IS AN EXPERIMENTAL EA NOT YET BEING USED ON OUR LIVE ACCOUNTS Well, it's finally in the alltogether! This is a combination of 3 of Steve's EA's... Once A Week Basket Trader, Version 1_d, which you can find here... http://www.stevehopwoodforex.com/phpBB3 ... f=5&t=3587 If you haven't done so already, read at least the first post to learn what it does, I'll wait here 'til you get back. Once A Day Basket Trader, Version 1, here... http://www.stevehopwoodforex.com/phpBB3 ... f=5&t=3628 Again, read at least the first post. And, finally, Once A Month Basket Trader, Version 1_d, here... http://www.stevehopwoodforex.com/phpBB3 ... f=5&t=3649 Read the first 3 posts. As well as combining these 3 systems into one EA, I've added Basket Management for each system, and ATR based Individual Trade Management. Before I explain the settings... If you feel like putting this on a live account (especially if you use it with OOTB settings), save yourself the stress of a long, drawn-out trip into depression and the poor-house by selling ALL of your assets, max out your credit cards, take out a personal loan for a few hundred grand, and send all that luvverly money to me, 'cos seriously, I need it more than your broker does! Now that that's out of the way... Universal Settings... PairsToTrade: Needs no explanation, so I ain't givin' one. Lot=0.01; Lots per trade. IsGlobalPrimeOrECNCriminal = true; I don't know if this is needed any more, as it's not in Steve's 3 original Once A(...) EA's... I'd pulled the function SendSingleTrade from my old multi-timeframe EA, which needed this... Basically, does your broker require 2-stage order-placement (Opent trade first, then send SL & TP later) or not? MaxSlippagePips=5; PromoteTrades = false; Promote Trades Through TimeFrames? (Individual Trade Management Module will only work if PromoteTrades is enabled). Eplained further in the following 3 posts. MagicNumber=795; Pick a number, any number... If you're using multiple instances in the same Empty4, pick another number, any other number. AlwaysOn=true; If false, OAW will loop round OnTick twice a second rather than waiting for every tick. EnableLargeFont = false; Suck it and see MainFont = "Times" ; Has no effect if EnableLargeFont is false. MainFontSize = 12 ; Ditto. StatsFont = "New Roman" ; Ditto. StatsFontSize = 12 ; Ditto. ShowPairInfo=false; Ditto.. Edit 2/8/2014 You need a huge monitor, and tiny fonts in Windows to see this if you enable all 3 systems... Is visible when 2 are enabled, though. ShowTradingChoices=true; Enables display of Trading Days/Times, Basket SL, BE, BEP, JSL, etc. Works with or without EnableLargeFont enabled. DisplayGapSize=30; Has no effect if EnableLargeFont is true ----Trade Management Module For Individual Trades---- AtrPeriod=14; Sets the ATR period for all pairs... Used for calculating SL, BE, etc. SLMultiplier=2 Multiplies the ATR by this to determine StopLoss for each trade BreakEvenMultiplier = 3; Multiplies each pair's ATR to determine BE. BreakEvenProfitMultiplier = 0.5; As above, for BEP JumpingStopMultiplier=3; As above for JS AddBEP=false; Add BEP to JS on each jump? JumpsBeforeExport = 2; How many times the JS is triggered for each trade before its BE, BEP, and JS are re-calculated based on the next higher timeframe's ATR values. You will notice that there's no TakeProfit for individual trades... I don't use them unless I'm intentionally playing in a ranging market, or I'm scalping, and with this EA, I'm trying to get in early on longer-term trends. Trade entry/exit settings... The entry/exit settings are self explanatory, but, if you need them explained, gpo back to Steve's threads Basket Settings... The 3 Baskets have the same management setting names, with the timeframe prepended, e.g D1_CashProfitTarget, W1_CashProfitTarget, and MN1_CashProfitTarget, for the Daily, Weekly, and Monthly, respectively. I'll put them here with TF instead of any particular timeframe, e.g. TF_CashProfitTarget. All "PerTrade" settings are multiplied by the number of trades in the basket. TF_CashProfitTarget=0; Fixed TakeProfit. Close the Basket at this many dollars profit. Zero input turns this off. TF_CashProfitTargetPerTrade=1; Adaptive StopLoss (If you get 10 trades in a basket, that basket's YP is 30). Zero value disables this function. TF_Basket_CashStopLoss = 0; Fixed StopLoss (Ignores size of Basket). TF_Basket_CashStopLossPerTrade = 3; Adaptive StopLoss (If you get 10 trades in a basket, that basket's SL is 30). TF_Basket_BreakEvenProfitCash = 0; Fixed BreakEven (Ignores size of Basket). TF_Basket_BreakEvenProfitCashLock = 0; Fixed BreakEven Profit (Ignores size of Basket). TF_Basket_BreakEvenProfitCashPerTrade = 5; Adaptive BreakEven (If you get 10 trades in a basket, that basket's BE is 50) TF_Basket_BreakEvenProfitCashLockPerTrade = 1; Adaptive BreakEvenProfit (If you get 10 trades in a basket, that basket's BEP is 10) TF_Basket_JumpingStopCash = 0; Fixed JumpingStopLoss (Ignores size of Basket) TF_Basket_JumpingStopCashPerTrade = 5; Adaptive JumpingStopLoss (If you get 10 trades in a basket, that basket's JSL is 50). If I think of anything else to add to this post, I'll add it. 1st add... Preferred testing method for now is here... http://www.stevehopwoodforex.com/phpBB3 ... 861#p96861 2nd add... Things to do... Add options to OAD & OAW that allows... i. Only taking signals that agree with OAM (which means they won't trade until monthly direction is set). ii. Taking all their own signals until monthly direction is set, then goto (i). iii. Ignoring monthly direction entirely. Tue, 12th Aug, 2014 Done (sort of)... Passed back-testing (bug-hunting), will post on the weekend. Sunday, August 17, 2014 Posted. Extend user-feedback to show locked-in profit/loss per management timeframe, plus totals, when EnableLargeFont = true. Code an indicator to show pair info (current Bid, movement from Open, % of ATR, and ATR for Daily, Weekly, & Monthly). Tue, 12th Aug, 2014 Pathumracled suggested adding capability for Fixed Risk Per Trade... I'm on the hunt for the code now Sat, 27th Sept, 2014 Tsedawa noticed that I missed a couple of lines that are vital for the swap filter. Fixed and updated. Have fun! Radar =8^) |
|
| Author: | Radar [ Mon Jun 16, 2014 3:58 pm ] |
| Post subject: | Once Upon A Timeframe |
Greetings folks, Opening paragraphs of original post (Tue 17th June). I've been following the evolution of the Once A Week, Once A Day, and Once A Month EA's, and, as usual, I'm seeing great work For the past couple of years, I have been trying to code a multi-timeframe approach to trade management so that I can enter trades on the M1, and eventually manage them on the MN1. End Tue 17th June post. =========================================================================================== Friday, 11th July Once Upon A TimeFrame - Stage 1. (Once A Day Basket Trader with Multi-TimeFrame Trade Management). I have added an option to "Promote" trades... Turn it off, and the EA works the same as Steve's original EA, turn it on, and you have the ability to manage the stops of individual trades, and remove them from the basket. It uses the same settings as the original, with a few extras. Extra Settings... D1_TradeComment = "OAD"; MagicNumber = 795; Change to whatever you want, just don't use 0 if you have other EA's running. PromoteTrades = true; The following settings are disabled if this is set to "false". SLMultiplier = 2; All "Multiplier" Settings are based on the 14 Period ATR of each Pair's H1 chart. BreakEvenMultiplier = 3; BreakEvenProfitMultiplier = 0.5; JumpingStopMultiplier = 3; Starts at the 14 Period H1 ATR, then, as a trade is exported, it goes through H4, D1, W1, & MN1 for that trade's Pair only. AddBEP = false; JumpsBeforeExport = 1; How many times you want the JS moved before trades get exported to a higher timeframe. How it works... Trades are entered as normal, with their ticket numbers stored in an array. Each trade is given a StopLoss, BreakEven, BreakEvenProfit, & JumpingStop, each calculated as multiples of the 14 Period ATR of the H1 chart for that trade's symbol. Once a trade's JumpingStop has kicked in, and has jumped "JumpsBeforeExport" times, that trade's ticket number is exported from the basket array, and imported into a second array... Trades in the second array have their JumpingStops calculated based on the 14 Period ATR of the H4 chart for that trade's symbol, and, again, the trade is exported when its JumpingStop has moved "JumpsBeforeExport" times, and is imported into an array etc... If the trade doesn't get stopped-out, it will eventually be managed according to the 14 Period ATR of the MN1 chart for that symbol. It is important to remember that once a trade has been exported from the H1 array, it is no longer part of the basket! It doesn't get closed when the basket is closed for the day. If you use "D1_CashProfitTargetPerTrade" to calculate the basket TakeProfit, it is re-calculated automatically, e.g... D1_CashProfitTargetPerTrade = 5. Trades Open = 23. (None Eported (Not shown in User Feedback)). Basket TakeProfit = 115. ...After a few hours, 4 trades get exported, and you will see... D1_CashProfitTargetPerTrade = 5. Trades Open = 19. (Plus 4 exported trades (Not shown in User Feedback)). Basket TakeProfit = 95. ...Basket TakeProfit is also re-calculated if any trades in the basket get stopped-out. Things to do before adding the "Once A Week" components... 1. Make sure that BEP is calculated based on the entry-timeframe's ATR, as it currently gets recalculated based upon the timeframe that the trade is being managed under. Edit... Tue, 22 July. Not an issue 2. Code a Basket TrailingStop. The function needs to be generic, so that it can be used for "Once A Week" and "Once A Month" without them stomping all over each other. It will have to be re-calculated each time a trade is exported from the basket. Edit... Tue, 22 July. Done End Fri 11th July post. Edit... Minor bugfix... =========================================================================================== Tue 22 July Added Basket Management function, which, for the moment, cannot be disabled, and only takes Cash inputs, (No Pips input). I'll add those options later, if there's enough demand for them. New Inputs... D1_Basket_CashStopLoss = 0; D1_Basket_CashStopLossPerTrade = 3; D1_Basket_BreakEvenProfitCash = 0; D1_Basket_BreakEvenProfitCashLock = 0; D1_Basket_BreakEvenProfitCashPerTrade = 5; D1_Basket_BreakEvenProfitCashLockPerTrade = 1; D1_Basket_JumpingStopCash = 0; D1_Basket_JumpingStopCashPerTrade = 5; The "PerTrade" inputs override the non-"PerTrade" versions. All info is displayed in the user feedback on the chart. If you enable "PromoteTrades" you will see the original basket size, as well as the current basket size should any trades be taken out of the basket (either through manual intervention, stoploss hit, or trades being "promoted" to a higher timeframe for management). Should a trade be taken out of the basket, all of the basket management values are reset to zero, (count of trades, SL, BE, BEP, JSL), except for Highest Unrealized Profit/Loss which is reset to -1000000, and Original Basket Size, which is only reset at Basket Closing Time. Everything is then re-calculated based on the new count of trades. Unless anyone comes up with extras to be added, or bugs to be fixed, I'll start on adding OAW Edit, Sunday, August 17, 2014 Added new functionality & settings... We now have the ability to choose whether to force OAD to follow the Monthly direction, (Not OAM's direction)... How it works... During the Daily Open Hour, we check where price is in relation to the Monthly Open to find the current monthly direction, as well as checking where price is in relation to the Weekly Open to determine the current weekly direction... From there, the following setting determines what we do... D1_TradeSignalChoice = ? 0 (Zero) = Trade according to the current Weekly direction, (same as the original OAD). Ignores Current Monthly direction. 1 = As above, until OAM Open Time, at which point we compare Current Weekly & Current Monthly directions... Enter trade if they are the same. 2 = Only enter trades during OAM trading days, comparing Current Weekly & Current Monthly (Not current OAM) directions... Enter trade if they agree. Take care, & Have fun! Radar =8^) Sunday, August 17, 2014 Removed Once a Day basket trader v1_d with MTFTM.mq4, as fuctionality has been improved and merged into OUATF. |
|
| Author: | Radar [ Mon Jun 16, 2014 3:58 pm ] |
| Post subject: | Once Upon A Timeframe |
Once A Week... Basket Settings have the same names, except they're W1_ instead of D1_... TradeComment = OAW. If PromoteTrades = true. the following takes place, otherwise, it runs without individual trade SL, JSL, or TP. When trades are opened, their ticket numbers are stored in an array. All trades in that array are given SL, BE, BEP, and JSL, based on a 14 (User adjustable) period ATR of the H4 chart. When a trade's JSL has been moved "JumpsBeforeExport" times, it is removed from the array, and placed into a second array... Trades in the second array have their JSL calculated based on the ATR (same period) of the Daily chart. Each time JSL is moved "JumpsBeforeExport" times on each timeframe, it is moved up to the next timeframe, until it reaches the Monthly chart. Again, it is important to remember that once a trade has been exported from the original array, it is no longer a member of the weekly basket! All basket stats and SL, etc, are adjusted automatically. Edit, Sunday, August 17, 2014 Added new functionality & settings... We now have the ability to choose whether to force OAW to follow the Monthly direction, (Not OAM's direction)... How it works... During the Weekly Open Hour, we check where price is in relation to the Monthly Open to find the current monthly direction, as well as checking where price is in relation to the Weekly Open to determine the current weekly direction... From there, the following setting determines what we do... W1_TradeSignalChoice = ? 0 (Zero) = Trade according to the current Weekly direction. Ignores Current Monthly direction. 1 = As above, until OAM Open Time, at which point we compare Current Weekly & Current Monthly directions... Enter trade if they are the same. 2 = Only enter trades during OAM trading days, comparing Current Weekly & Current Monthly (Not current OAM) directions... Enter trade if they agree. Have fun! Radar =8^) |
|
| Author: | Radar [ Sat Jul 12, 2014 1:21 am ] |
| Post subject: | Once Upon A Timeframe |
Sunday, Aug 17, 2014 Once A Month... Basket Settings have the same names, except they're MN1_ instead of W1_... TradeComment = OAM. If PromoteTrades = true. the following takes place, otherwise, it runs without individual trade SL, JSL, or TP. When trades are opened, their ticket numbers are stored in an array. All trades in that array are given SL, BE, BEP, and JSL, based on a 14 (User adjustable) period ATR of the D1 chart. When a trade's JSL has been moved "JumpsBeforeExport" times, it is removed from the array, and placed into a second array... Trades in the second array have their JSL calculated based on the ATR (same period) of the Weekly chart. From there, when JSL is moved "JumpsBeforeExport" times, it is moved up to the Monthly chart. Again, it is important to remember that once a trade has been exported from the original array, it is no longer a member of the Monthly basket! All basket stats and SL, etc, are adjusted automatically. Have fun! Radar =8^) |
|
| Author: | SteveHopwood [ Sun Jul 13, 2014 9:13 am ] |
| Post subject: | Once Upon A Timeframe |
Outstanding stuff Radar - brilliant ideas. |
|
| Author: | Radar [ Sun Jul 13, 2014 9:43 am ] |
| Post subject: | Once Upon A Timeframe |
Thanks, Steve I'm currently looking at some older basket trading EA's to work out how to do the basket trailing stop. Take care, & Have fun! Radar =8^) |
|
| Author: | SteveHopwood [ Sun Jul 13, 2014 11:11 am ] |
| Post subject: | Once Upon A Timeframe |
I just had a thought Radar. I would be happy to bet a pound to a penny that Paul's mpbm has waterproof trailing/jumping stop code you could pinch. |
|
| Author: | Radar [ Sun Jul 13, 2014 11:14 am ] |
| Post subject: | Once Upon A Timeframe |
Y'know, I think ya just might be right there |
|
| Author: | SteveHopwood [ Tue Jul 15, 2014 8:03 am ] |
| Post subject: | Once Upon A Timeframe |
I forgot to set up my demo for yesterday. It is up and running now. 13/23 trades. |
|
| Author: | Radar [ Tue Jul 15, 2014 9:08 am ] |
| Post subject: | Once Upon A Timeframe |
Found & fixed a bug... JumpingStop & ExportTrades sometimes gets an ATR of 0, so added a test in both functions, and skips that trade 'til the next cycle. Updated version is in post 2 (here... http://www.stevehopwoodforex.com/phpBB3 ... 556#p94556 ). Have fun! Radar =8^) |
|
| All times are UTC | Page 1 of 8 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|