I can't figure out what strategy the algorithm is based on, the input parameters are only trading conditions...?
I can't figure out what strategy the algorithm is based on, input parameters are only trading conditions...?
The strategy itself is written in these lines:
//--- it may be a good idea to also avoid NFP days, first thursday in any month. if((!session_found) && (str1.hour==Start_hour_US_session)) { //--- first time through, compute EU session highs and lows. TopRange=iHighest(m_symbol.Name(),Period(),MODE_HIGH,24,1); // 24 M15 bars during EU session LowRange=iLowest(m_symbol.Name(),Period(),MODE_LOW,24,1); // 24 M15 bars during EU session //--- if(TopRange<=0.0 || LowRange<=0.0) return; //--- if((TopRange-LowRange)<=ExtSmallEUSessionPips) small_session=true; else small_session=false; session_found=true; string text=(small_session)?"true":"false"; Print("Identified new EU session + ["+ DoubleToString(LowRange,m_symbol.Digits())+","+ DoubleToString(TopRange,m_symbol.Digits())+"]"+ " DayOfYear()="+IntegerToString(str1.day_of_year)+" small? "+text); }
We have an input parameter"Start_hour_US_session" - as soon as we find a correspondence of the current time (we compare only hours) with this parameter, we start looking for the highest value of maximum prices for the period of 24 bars and the lowest value of minimum prices for the period of 24 bars. If the difference of these prices is less than or equal to the input parameter"Small EU Session (in pips)", it means that a"small session " (in pips) has been detected. - then a "small session" (with small volatility) -"small_session" - has been detected.
When we are inside the "US session" and a "small session" (with small volatility) is found - "small_session"
if(session_found && small_session && (str1.hour>=Start_hour_US_session) && (str1.hour<End_hour_US_session)) // Within US session hours? { //--- Calculate EU session range //--- Print("Am in US session.... small_session, bought, sold = " + small_session+bought+sold); //--- Print("TopRange = " + TopRange + "LowRange = " + LowRange); int h=str1.hour; int m=str1.min; if(h>Start_hour_EU_session+5 && h<Start_hour_EU_session+10) {//--- at least one US session bar should be completed //--- Print("Could be buying/selling... "+h+": "+m); double low=iLow(1); double high=iHigh(1); //--- if(low==0.0 || high==0.0) return; //--- if(!RefreshRates()) return; if((!bought) && (low>(TopRange+Point()*3))) { if(OpenBuy(m_symbol.Bid()-ExtStopLoss,m_symbol.Ask()+ExtTakeProfit)) bought=true; } if((!sold) && (high<(LowRange-Point()*3))) { if(OpenSell(m_symbol.Ask()+ExtStopLoss,m_symbol.Bid()-ExtTakeProfit)) sold=true; } } // end if in 2nd US time. }// end if small session
we wait until we are inside the "EU session" and get Low and High values from the first bar.
Condition for opening BUY: if no BUY position has been opened on this day and the Low of bar number 1 is MORE than the highest value of the maximum prices for the period of 24 bars in the "US_session":
if((!bought) && (low>(TopRange+Point()*3))) { if(OpenBuy(m_symbol.Bid()-ExtStopLoss,m_symbol.Ask()+ExtTakeProfit)) bought=true; }
Condition for opening SELL: if no SELL position has been opened yet on this day and the High of bar number 1 is LESS than the lowest value of the minimum prices for the period of 24 bars in "US_session":
if((!sold) && (high<(LowRange-Point()*3))) { if(OpenSell(m_symbol.Ask()+ExtStopLoss,m_symbol.Bid()-ExtTakeProfit)) sold=true; }
ds
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
EURUSD breakout:
The EA trades during two trading sessions, starting at the specified session beginning time. Stop Loss. Take Profit.
Author: Vladimir Karputov