Papa4x Posted December 16, 2010 Report Share Posted December 16, 2010 All credit goes to JonDgls=D> NightHawk v1.0 http://imagebin.us/images/ilqt1nr86doybugarzn1.jpg Night Hawk is a breakout strategy that looks at the highest high and lowest low between 22:00 GMT and 05:00 GMT (7 Hours). It then sets pending Buystop and Sellstop orders at X pips away from the high and low (Order_Gap variable), ready to catch a breakout. If neither order is triggered by 21:00 GMT then both orders are deleted. This expert differs from Azure Dragon because AD uses one hour to calculate the breakout range where as NightHawk uses seven hours. It is very similar to many of the breakout systems that are on the market today such as Forex Morning Trade, Forex Signal Base and Forex Fisher Bot but this one is different because it’s: • FREE! ;). • More configurable. • Supported here on ForexIsBiz by me and the community. • Open to suggestions for improvements and upgrades. • Has a built in indicator that uses the EA’s settings to display the range, the order gaps and the profit target for as many days as you like (e.g. past 100 days) making it very easy to visually back test. NightHawk includes all of the features I now consider standard such as: • AutoGMT Offset • Trailing Stops • Manual Summer / Winter GMT variables. • Break Even • Auto / Manual SL • Money Management • Auto ECN / STP detection. Here is a description of NightHawks important variables: Close_Opposite_Order: If TRUE, once one pending order is opened, the opposite pending order is deleted. Order_Gap: The gap, in pips, you want the pending order to be placed above the high and below the low. SmallRange (when StopLoss_Mode = 0 (Auto)): I found that small ranges often caused triggered orders to be stopped out before the breakout occurred because the stop loss was too close. If the range is equal to or less than this pip value, the Stop Loss will be set to the opposite orders open price (i.e. the range high/low + Order_Gap). If the range is greater than this pip value the Stop Loss will be set to the range high/low only. This just gives more breathing space to orders on small ranges. BreakEvenStartPips: The amount of pips in profit that NightHawk should move the SL to break even. BreakEvenProfitPips: The amount of pips in profit that NightHawk should consider as the break even point. StopLoss_Mode: Auto is explained in SmallRange variable description above. Manual allows you to set your own fixed SL using the User_Stop_Loss variable. ShowIndicator: Shows you the range, order gap and profit target on the chart. NumberOfDays: Draws the indicator on this number of days. Timeframe: M15 Pairs: Tested on EURUSD. Optimization continues on GBPUSD. I have included a set file and template for EURUSD. Enjoy! EURUSD.set M15 - 2010 Back Test: http://imagebin.us/images/a62ou7eoz84nib85fj2b.gif Download: [url="http://www.multiupload.com/AGT93U485H"]http://www.multiupload.com/AGT93U485H[/url] Password: forexisbiz Raven, yoske, halcyonn and 13 others 16 Quote Link to comment Share on other sites More sharing options...
pro Posted December 16, 2010 Report Share Posted December 16, 2010 thx. As good as it looks with the optimized 2010 BT, it would be a challenge to find a real good set up for a 10 year backtest.. Quote Link to comment Share on other sites More sharing options...
halcyonn Posted December 16, 2010 Report Share Posted December 16, 2010 (edited) hi,getting order error 131.any ideas please? 2010.12.16 09:11:29 2010.12.08 07:30 NightHawk v1.0 GBPUSD,M15: Error opening Sell order : 131 same error for eurusd too with provided .set file. Edited December 16, 2010 by halcyonn Quote Link to comment Share on other sites More sharing options...
ablanchi Posted December 17, 2010 Report Share Posted December 17, 2010 ... same error for me!! halcyonn 1 Quote Link to comment Share on other sites More sharing options...
ho3ain190 Posted December 17, 2010 Report Share Posted December 17, 2010 http://www.multiupload.com/AGT93U485H Quote Link to comment Share on other sites More sharing options...
Papa4x Posted December 18, 2010 Author Report Share Posted December 18, 2010 hi,getting order error 131.any ideas please? 2010.12.16 09:11:29 2010.12.08 07:30 NightHawk v1.0 GBPUSD,M15: Error opening Sell order : 131 same error for eurusd too with provided .set file. check the min lot size allowed by the broker. regards Quote Link to comment Share on other sites More sharing options...
halcyonn Posted December 18, 2010 Report Share Posted December 18, 2010 ERR_INVALID_TRADE_VOLUME 131 Invalid trade volume, error in the volume granularity. All attempts to trade must be stopped, and the program logic must be changed. this is mql4base..i think something needs to be fixed inside the code. Quote Link to comment Share on other sites More sharing options...
halcyonn Posted December 18, 2010 Report Share Posted December 18, 2010 (edited) http://www.multiupload.com/AGT93U485H thanx Ho3ain! this version works edit:still getting intermittent error 131.can someone please make the code clean? Edited December 18, 2010 by halcyonn Quote Link to comment Share on other sites More sharing options...
jdsim1 Posted December 18, 2010 Report Share Posted December 18, 2010 ... same error for me!! turn off mm and test with .1 lot. Its probable your broker does not allow fractional lots such as .15 Quote Link to comment Share on other sites More sharing options...
halcyonn Posted December 18, 2010 Report Share Posted December 18, 2010 Strategy Tester Report NightHawk v1.0 AlpariUK-Demo (Build 229) Symbol EURUSD (Euro vs US Dollar) Period 1 Hour (H1) 2010.07.08 09:00 - 2010.12.17 22:00 (2010.07.01 - 2010.12.18) Model Every tick (the most precise method based on all available least timeframes) Parameters ExpertName="NightHawk v1.0"; Author="JonDgls @ www.ForexIsBiz.com"; _1="+------------ Time Settings ------------+"; AutoGMT_Offset=true; GMT_Offset_Manual_Summer=3; GMT_Offset_Manual_Winter=3; _2="+---------- Strategy Settings ----------+"; Close_Opposite_Order=true; Use_Trailing_Stop=true; Trailing_Stop=40; Order_Gap=21; SmallRange=45; Take_Profit=45; BreakEvenStartPips=45; BreakEvenProfitPips=30; StopLoss_Info="0=Auto; 1=User"; StopLoss_Mode=1; User_Stop_Loss=65; _3="+----- Money Management (10 = 10%) -----+"; MM=false; Risk=10; _4="+---- Lots Management (If MM=False) ----+"; Fixed_Lots=1; Min_Lot=1; Max_Lot=10000; _5="+---------------- Misc -----------------+"; Buy_Comment="NightHawk BUY"; Sell_Comment="NightHawk SELL"; MagicNumber=111; _6="+---------- Indicator Settings ---------+"; ShowIndicator=false; UniqueID="NightHawk"; NumberOfDays=2; RangeBox_Background=MidnightBlue; RangeBox_Border=SlateGray; TargetBox_Background=SlateGray; TargetBox_Border=SlateGray; Bars in test 3238 Ticks modelled 4324451 Modelling quality 90.00% Mismatched charts errors 0 Initial deposit 10000.00 Total net profit 5385.20 Gross profit 22310.60 Gross loss -16925.40 Profit factor 1.32 Expected payoff 70.86 Absolute drawdown 1758.80 Maximal drawdown 3110.00 (23.70%) Relative drawdown 23.70% (3110.00) Total trades 76 Short positions (won %) 30 (73.33%) Long positions (won %) 46 (60.87%) Profit trades (% of total) 50 (65.79%) Loss trades (% of total) 26 (34.21%) Largest profit trade 1234.00 loss trade -664.00 Average profit trade 446.21 loss trade -650.98 Maximum consecutive wins (profit in money) 7 (2601.00) consecutive losses (loss in money) 3 (-1950.60) Maximal consecutive profit (count of wins) 2865.20 (6) consecutive loss (count of losses) -1950.60 (3) Average consecutive wins 3 consecutive losses 2 ============================ its a test of optimised settings of period jan 1 2010 to july 1 2010 being run on period from july 1 2010 to december 2010. not too bad in any case. Quote Link to comment Share on other sites More sharing options...
ablanchi Posted December 19, 2010 Report Share Posted December 19, 2010 turn off mm and test with .1 lot. Its probable your broker does not allow fractional lots such as .15 Thank you!! Quote Link to comment Share on other sites More sharing options...
Papa4x Posted January 11, 2011 Author Report Share Posted January 11, 2011 updated v1.2 http://www.multiupload.com/A72WNNPAW3 pass : forexisbiz as discussed on the neighbour forum: http://www.forexisbiz.com/showthread.php/1499-FIB-NightHawk-v1.2 Update 07/01/2011 (v1.2): I have corrected the last remaining issues (hopefully) related to ranges crossing midnight and GMT offsets. The most recent issue was orders being placed at the incorrect price. This should now be resolved. I have also added some magic number info to the display and the order comments so you can easily tell which pending orders belong to which instance of NightHawk on the same currency pair. I have also added a CloseOrdersOnDenit option which, when set to TRUE will close all pending orders opened by the expert on this chart if NightHawk deinitializes. Experts deinitialize when the following occurs: new properties or set expert is removed from chart chart is closed MT4 is closed I found this particularly useful while I was testing different ranges to see if orders would open correctly. As I changed the settings, old orders would delete and new orders where placed. I left it in just in case its helpful . Default setting is FALSE. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.