Trabajo finalizado
Tarea técnica
I want a the strategy in this video coded.
Video References:
https://www.youtube.com/watch?v=oeoz94F2yJs&t=289s
https://www.youtube.com/watch?v=aqoZljCiL-A&t=208s
https://www.youtube.com/watch?v=8xV8QI3I-GQ&t=543s
From what I understand in the videos these are the rules:
lets limit to one trade per kill zone per pair. So at max 2 trades if you get a signal on both pairs during the same kill zone.
1. Can only take trades between the hours of: (we will call these kill zones)
06:30-09:00 GMT and 12:00 - 1430 GMT
2. Looks for signals on both the pairs GBPUSD and EURUSD
3. Do not enter a trade 1 hour before and 15mins after news starts for red folder news for GBP/EUR/USD
4. Uses fractals on the 4 hour and 15min timeframe
5. we use the 4 hour for bias.
Fractal High NF
if the 4 hour candle has crossed above the previous 4 hour fractal high and then closed below the previous fractal high of the last 4 hour fractal then that = HNF
if 1 candle on the 4 hour closes above the previous 4 hour fractal high and then the next 4 hour candle close below the previous 4 hour fractal high then that = HNF
if the 4 hour candle has crossed below the previous 4 hour fractal low and then closed above the previous fractal low of the last 4 hour fractal then that = LNF
if 1 candle on the 4 hour closes below the previous 4 hour fractal low and then the next 4 hour candle close above the previous 4 hour fractal low then that = LNF
Fractal High FF
if two 4 hour candles close above the last 4 hour fractal high then that = HFF
if two 4 hour candles close below the last 4 hour fractal low then that = LFF
No bias
If one candle closes above the previous 4 hour fractal high then that = NB
If one candle closes below the previous 4 hour fractal low then that = NB
6. Premium/discount
If current price has crossed above the previous 4 hour fractal high then draw a range from the current highest high to the previous fractal low.
If current price has crossed below the previous 4 hour fractal low then draw a range from the current Lowest low to the previous fractal low.
Premium = top 50% of range
Discount = bottom 50% of range
7. Entry Rules
Must be on the 15min timeframe and within the kill zone times stated above
if HNF then you can only take sell trades if bid price crosses valid previous 15min fractal high within the premium range.
if LNF then you can only take buy trades if ask price crosses valid previous 15min fractal low within the discount range.
if HFF or LFF then you can place buy or sell order depending on which previous fractal was cross first.
if NB then we do not open any trades until a HNF, LNF, HFF, LFF appears.'
A) 15 min valid fractals
if ask price has cross below the previous 15min fractal low before the kill zone then that fractal is not a valid fractal to use. Use the previous 15min fractal low that's before it if it has not been crossed before the kill zone.(hope that makes sense/use video reference)
if bid price has cross above the previous 15min fractal high before the kill zone then that fractal is not a valid fractal to use. Use the previous 15min fractal high that's before it if it has not been crossed before the kill zone.(hope that makes
sense/use video reference)
1. During kill zone
BUYS
if LNF then when the ask price crosses below the previous valid 15min fractal low in the discount range then that's our BUY signal 15min candle close.
after the signal candle closes we enter a BUY if the ask price crosses above the signal candle high and we place the stop loss 1 pip below the signal candle low and the risk to reward Is 3:1 with a take profit within the premium/discount range that was drawn.(the video explains this in detail.)
if the ask price does not cross above but it crosses below the signal candle then we reset it to be the new 15min signal candle and reset the BUY process above.(loop?)
if the ask price after the signal candle has a high below the signal candle high and a low above the signal candle low then we do not change anything and we wait for price to cross above the signal candle's high.
if ask price does not cross the signal candle high within the kill zone time then we do not enter any trades until the next kill zone time trade signal.
SELLS
if HNF then when the bid price crosses above the previous valid 15min fractal high in the premium range then that's our SELL signal 15min candle close.
After the signal candle closes we enter a SELL if bid price crosses above the signal candle high and we place the stop loss 1 pip above the signal candle high and the risk to reward Is 3:1 with a take profit within the premium/discount range that was drawn.(the video explains this in detail.)
if the bid price does not cross below but it crosses above the signal candle then we reset it to be the new 15min signal candle and reset the SELL process above.(loop?)
if the bid price after the signal candle has a high below the signal candle high and a low above the signal candle low then we do not change anything and we wait for price to cross above the signal candle's low.
if bid price does not cross the signal candle low within the kill zone time then we do not enter any trades until the next kill zone time trade signal.
if HFF/LFF
you can do either the BUY or SELL whichever one comes first. it doesn't matter if its premium/discount.
8. fractal break
if the previous 4 hour fractal high or low is cross during the kill zone we do not enter any trades until its finished so we can find out if we got a HNF,LNF,HFF,LFF,NB.
Inputs:
RISK: (I want the risk split between the two pairs. so if I type $1000 risk then I only want it to take a maximum loss of $500 each pair)
Fixed lots
Percentage of Account balance
Percentage of Account equity
specific amount in USD. example - $100.00
EQUITY PROTECTOR:( if account equity reaches X amount in loss then pause trades for 48 hours.)
Toggle this function ON/OFF
Amount in USD(for example if my initial balance is 100000 I want to just type 95000 so that it stops there)
Hours the EA pauses
EQUITY STOPPER:( if account equity reaches X amount in profit then turn off EA.)
Toggle this function ON/OFF
Amount in USD(for example if my initial balance is 100000 I want to just type 105000 so that it stops there)
I think I got it. let me know if you have questions or need to add in something you saw in the videos.
please provide source code .mq5
Thank you.