MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
MQL5 Documentation is the Developer's Bible

Open/Close Trade For Candle

Back to topics list To post a new topic, please log in or register
avatar
9
zelda56789 2009.10.08 01:12
 
If I wanted to open/close a short/long trade using the below criteria, what methodes and/or stratagies would you recommend to me to accomplish following candles:

Tail is n % of total Hammer height - input=Minimum percentage of total Candle height represented by the Tail.

Long Trade, Open Candle:

Open – Low

------------- = n%
High – Low

Long Trade, Closed Candle:
Close – Low
-------------- = n%
High – Low

Short Trade, Open Candle:
High – Close
-------------- = n%
High – Low

Short Trade, Closed Candle:
High – Open
-------------- = n%
High – Low

Hammer is n pips in height (H to L) - input=Minimum height of candle in pips.

There is 'no cover' for preceding n bars - input=Number of pips that S/L will trail 2nd half of trade after each new high/low is made. ***If this is set to 0, both positions exit at Take Profit input.
Long trades: Tail low must be the lowest price for the preceding n bars. If a lower price was marked at any time during the prior n bars, the Long Hammer is disqualified and no trade is initiated.
Short trades: Tail high must be the highest price for the preceding n bars. If a higher price was marked at any time during the prior n bars, the Short Hammer is disqualified and no trade is initiated.

There must be an x pips move over n bars prior to Hammer (x pips move down for Long Hammer, x pips move up for Short Hammer) - input=Beginning time – sets the GMT hour that EA becomes active. Ending time – sets the GMT hour that EA becomes inactive (goes inactive at scheduled time if no trades are open; if trade is open, goes inactive as soon as trade is closed out by EA rules).
 
Argentines Strive towards Stocks as Default Propels Best Gains

Argentines Strive towards Stocks as Default Propels Best Gains

Bloomberg: Argentina’s debt crisis is causing the world’s biggest stock gains as investors buy equities to protect themselves against peso devaluation and soaring inflation.

avatar
9
zelda56789 2009.10.08 18:22 #
 

My current code is attached and I know that some of it is not working right, but it is trading.

I could use some help getting the above criteria working properly.

Attached files:
  candles.mq4  (34.36 KB)
 
avatar
9
zelda56789 2009.10.08 21:28 #
 
Here is the document I am trying to make happen.
Back to topics list  

To add comments, please log in or register