Forex Factory (https://www.forexfactory.com/)
-   Platform Tech (https://www.forexfactory.com/forum/69-platform-tech)
-   -   4H Weekly Box Breakout [TD] (https://www.forexfactory.com/thread/211656-4h-weekly-box-breakout-td)

Ronald Raygun Dec 15, 2009 4:44pm | Post# 1

4H Weekly Box Breakout [TD]
 
1 Attachment(s)
This system was based off of this system introduced to us by Ace284

The EA is TickDatabase enabled.

 

  1. xtern string Remark1 = "== Main Settings ==";
  2. extern int MagicNumber = 0;

    1. This number should be unique when multiple EAs are attached to a terminal.

  3. extern bool SignalsOnly = False;

    1. If set to true, the EA will only alert you to a trade using any combination of the alerts below.

  4. extern bool Alerts = False;

    1. If set to true, the EA will send a pop-up alert when a trading signal arrives.

  5. extern bool SignalMail = False;

    1. If set to true, the EA will send you an e-mail (assuming you set up your mail in your MT4 Terminal.) when a trading signal arrives.

  6. extern bool PlaySounds = False;

    1. If set to true, the EA will play the file, "alerts.wav" when a trading signal arrives.

  7. extern bool ECNBroker = False;

    1. Some brokers require EAs to first place a trade, and then modify the trade with the stoploss and takeprofit. If your broker requires this, set this value to True.

  8. extern bool TickDatabase = True;

    1. If set to True, the EA will send tick data into the tick database.

  9. extern bool CloseOnOppositeSignal = True;

    1. If set to true, the EA will close a trade if an opposite trading signal appears.

  10. extern bool EachTickMode = True;

    1. If set to true, the EA will take a trade immediately if it sees a signal. If set to false, the EA will take a trade only if there is a signal at the end of the bar.

  11. extern double Lots = 0;

    1. Fixed lot size

  12. extern bool MoneyManagement = False;

    1. Enables/Disables the lot sizing function.

  13. extern int Risk = 0;

    1. The percent of your available margin that you are willing to put into a trade.

  14. extern int Slippage = 5;

    1. Maximum slippage allowed when placing an order.

  15. extern bool UseStopLoss = True;

    1. Enables/Disables the Stoploss

  16. extern bool UseFixedStopLoss = True;

    1. Enables/Disables fixed stoploss

  17. extern int StopLoss = 100;

    1. Fixed stoploss in pips

  18. extern bool UseStopLossMultiplier = True;

    1. Enables/Disables the stoploss multiplier

  19. extern double StopLossMultiplier = 3;

    1. This is the stoploss based of a multiple of the range.

  20. extern bool UseTakeProfit = False;

    1. Enables/Disables Takeprofit

  21. extern bool UseFixedTakeProfit = True;

    1. Enables/Disables Fixed Take Profit

  22. extern int FixedTakeProfit = 60;

    1. Fixed TakeProfit in pips

  23. extern bool UseTakeProfitMultiplier = True;

    1. Enables/Disables the takeprofit multiplier

  24. extern double TakeProfitMultiplier = 3;

    1. Multiplier in multiples of the range.

  25. extern bool UseTrailingStop = False;

    1. Enables/Disables trailing stop.

  26. extern int TrailingStop = 30;

    1. Trailing stop in pips. Note, the EA will trail profits only.

  27. extern bool MoveStopOnce = False;

    1. Enables/disables the move-to-breakeven function.

  28. extern int MoveStopWhenPrice = 50;

    1. Trigger price to move the stoploss.

  29. extern int MoveStopTo = 1;

    1. Price in pips relative to breakeven to move the stoploss to once the trigger price is hit.
    2. Using these values as an example, the EA will move the stoploss to breakeven + 1 if the trade hits 50 pips profit.

  30. extern string Remark2 = "";
  31. extern string Remark3 = "== Breakout Settings ==";
  32. extern int DayStart = 0;

    1. 0 = Sunday
    2. 1 = Monday
    3. 2 = Tuesday
    4. 3 = Wednesday
    5. 4 = Thursday
    6. 5 = Friday

  33. extern int BarsFromWeekStart = 1;

    1. Number of bars to count from the week's start.

  34. extern int BreakoutBuffer = 0;

    1. Number of pips added to the top and bottom of the range.

  35. extern int MaxTradesPerWeek = 10;

    1. Maximum trades allowed per week

  36. extern int MaxLongsPerWeek = 8;

    1. Max long trades per week

  37. extern int MaxShortsPerWeek = 8;

    1. Max short trades per week

  38. extern string Days = "Sunday is 0, Monday 1, Friday 5, etc";
  39. extern bool UseCloseOnWeekEnd = False;

    1. Enables/Disables the week-end liquidation function

  40. extern int ClosePositionsDay = 5;

    1. Day that the trades are all forcibly closed.

  41. extern string ClosePositionTime = "23:00";

    1. Broker time where trades are all forcibly closed. Remember to use HH:MM format.

Note: You can enable all of the stoploss options if you so choose, just keep in mind that the EA will use the tightest stoploss available to it.
4H Weekly Box Breakout [TD].mq4


camvcvoo Jan 3, 2010 11:28pm | Post# 2

No trade trigger
 
1 Attachment(s)
Hi Ronald,

Can check why no trade trigger since pass the trigger price level as per strategy?

Picture attached.

Thanks.
Click to Enlarge

Name: GBPJPY H4.JPG
Size: 131 KB

Ronald Raygun Jan 3, 2010 11:50pm | Post# 3

Week status is none, I'm looking into it. Thanks for the heads up.

lolpie Mar 11, 2010 6:55pm | Post# 4

Have you looked at danno96's variations to the money management? It really overhauls the original 4H system. Link: http://www.forexfactory.com/showpost...postcount=2654

pipit100 Jan 16, 2018 9:37pm | Post# 5

Hi! Can we add Danno's variation to the system that Ace also incorporated and/or said is a good idea:

When TP #1 is hit, EA now moves SL to BE +20.
When TP #2 is hit, EA now moves SL to TP #1
When TP #3 is hit, EA now moves SL to TP #2
Ans, Move SL to 3X when price reach 4X and let profit run to WE

4) Do not trade when range is > than 200, SL will be > than 2%
5) Do not open new trade within the last 3 candle for the week but allow existing trade to run to last candle of the week

And incorporate Ace's Weekly ATR rule where it adjusts to a reasonable target other than TP4 when TP4 is beyond the Weekly ATR.


© Forex Factory