I have an algorithm which is based on candlestick formations - specifically the hammer candle formation.
Previously, the algorithm only executed short positions on bearish hammers & long positions on bullish hammers.
Now, however, I'm wanting to introduce inverse hammers, but keeping the wicks in the same positions (i.e., extended lower wicks for short positions and extended upper wicks for long positions)
It's not so much the interpretations of the global & local declarations themselves that are the issue, but it's the placement of the brackets that needs to be altered, as well as maybe introducing the "OR" or "ELSE IF" logic but I'll leave that up to you.
The instructions I'm needing it to follow - in layman’s terms - is the following:
"If '(BarTime != Time[0])' is true,
then assess if '(hammerHeadClose < hammerHeadOpen)' is True.
If (hammerHeadClose < hammerHeadOpen) is True, then assess if all of it's child statements are true.
If all of its child statements are also True, then execute a position.
Alternatively (OR/ELSE IF) if '(hammerHeadClose > hammerHeadOpen)' is true,
then assess if all of it's child statements are true.
If all of its child statements are true, then execute a position”.
Therefore, if(BarTime != Time[0]) must always be TRUE, but dependant on weather '(hammerHeadClose < hammerHeadOpen)' or '(hammerHeadClose > hammerHeadOpen)' will determine which set of child statements will be assessed to determine if a poition should be open.
Obviously (hammerHeadClose > hammerHeadOpen) & (hammerHeadClose < hammerHeadOpen) are mutually exclusive criteria (the closing price can either be above the opening or below the opening - doji's aren't allowed), there is no point in the EA assessing the child statements under (hammerHeadClose > hammerHeadOpen) when (hammerHeadClose < hammerHeadOpen) and visa-versa.
To put it another way "if(BarTime != Time[0]), assess "if(hammerHeadClose > hammerHeadOpen)".
If "if(hammerHeadClose > hammerHeadOpen)" is FALSE (for example), go straight to if(hammerHeadClose < hammerHeadOpen) and assess all child statements here".
I hope this helps, if you need any clarification, let me know.
The code in question is on line 315 (short position criteria) and line 795 (long position criteria).
I have enclosed documentation for the EA which includes the explanations to the Global Declarations which you will come across.
if(BarTime != Time[0])
{
if((hammerHeadClose < hammerHeadOpen)
&& (bearHammerHead >= Transform(candleBodyLength,2))
&& (bearHammerHandle!=0 && (bearHammerHead / bearHammerHandle) <= hammerHandlePct)
&& (bullRetracementCandle!=0 && (bearHammerHead / bullRetracementCandle) <= hammerHeadPct)
&& (bullRetracementCandle!=0 && (initialTrendBearCandle / bullRetracementCandle) <= retracePercentage)
&& (bullRetracementCandle >= Transform(candleBodyLength,2))
&& (trendFast < trendSlow)
&& (momentumFast < momentumSlow)
&& (NewBar)
&& (spread <= MaxSpread)
&& (hourOfDay >= startingHour && hourOfDay < endingHour)
&& (OrdersTotal()== 0))
if((hammerHeadClose > hammerHeadOpen)
&& (bullHammerHead >= Transform(candleBodyLength,2))
&& (bearHammerHandleInv!=0 && (bullHammerHead / bearHammerHandleInv) <= hammerHandlePct)
&& (bullRetracementCandle!=0 && (bullHammerHead / bullRetracementCandle) <= hammerHeadPct)
&& (bullRetracementCandle!=0 && (initialTrendBearCandle / bullRetracementCandle) <= retracePercentage)
&& (bullRetracementCandle >= Transform(candleBodyLength,2))
&& (trendFast < trendSlow)
&& (momentumFast < momentumSlow)
&& (NewBar)
&& (spread <= MaxSpread)
&& (hourOfDay >= startingHour && hourOfDay < endingHour)
&& (OrdersTotal()== 0))
{
bool OpenShort = OrderSend(.....);
}
}
비슷한 주문
JOB SPECIFICATION: Fully Automated ES/MES 5-Minute NY Opening Range Breakout EA 1. Project objective I am looking for an experienced trading algo developer to build a fully automated trading bot (EA) based on my specific 5-minute New York Opening Range Breakout strategy. The EA must identify setups, confirm breakouts, identify retests, confirm continuation, execute trades, calculate position size, place stop-loss and
Hello fellow traders! I am a professional Forex trader with over 16 years of continuous experience in the financial markets. I have developed my own proprietary trading system, which has demonstrated a win rate of over 90%. I am now looking to collaborate with traders who have struggled to achieve consistent profitability in the markets. I can offer you two options: 1. Strategy Training I can teach you my proprietary
I'm having an issue copying trades from my MT5 account to FTMO using Social Trader Tools (an MT5 trade copier). Social Trader Tools reports that automated trading is disabled and says FTMO needs to resolve it. However, FTMO confirms everything is fine on their end and advises enabling Algo Trading, which I've already done. I'm looking for someone who has specifically experienced and successfully resolved this exact
Title: Professional MT5 XAUUSD Multi-Strategy Expert Advisor Developer Needed I am looking for an experienced MQL5 developer to build or improve a fully automated MT5 Expert Advisor for XAUUSD on an Exness hedging account. Requirements: - Five independent trading engines: Rapid, Scalping, Sniper, Trend and Reversal. - Advanced SMC/ICT market structure, liquidity, BOS, CHoCH, order blocks and FVG analysis. - Multiple
i need this kind of ai expertadvivore i send you link of youtube chanal link please see its stretegy and make a bot this stretegy contact me at +923025084018 whatsapp https://www.youtube.com/watch?v=tG9D43ageBU chanel link https://www.youtube.com/@ForexRobot_MT4_MT5
I need liquidity sweep indicator ready made I need, please response only if you have ready made liquidity sweep and please send me .demo for testing and please describe me logic of this liquidity sweep indicator, I am searching professional indicator
Was wondering if it’s possible for you to recreate a trading indicator that I currently use, as it’s a private script. I just need to make sure I have the complete source code and can use my own version independently. I can provide screenshots of its settings and chart signals, along with examples of how it behaves. Would this be something you’d be able to develop
Hi there I need someone who can create an ea that calculate the next price movement points if it greater then the spread cost using atr,ema, it must place an dead order meaning if the market touches it , it dead only actives in profits message of me if you understand, or if you can create it
أبحث عن مطور MQL5 ذي خبرة لإنشاء مستشار خبير (EA) مخصص يعتمد على استراتيجية محددة لتتبع الاتجاهات مع إدارة صارمة للمخاطر. 1. متطلبات استراتيجية التداول: - مرشح الاتجاه: استخدم المتوسط المتحرك الأسي (EMA) لمدة 200 فترة على الإطار الزمني H1. * افتح صفقات الشراء فقط إذا كان السعر أعلى من المتوسط المتحرك الأسي 200. * افتح صفقات البيع فقط إذا كان السعر أقل من المتوسط المتحرك الأسي 200. - إشارة الدخول: استخدم مؤشر
//+------------------------------------------------------------------+ //| ModularMultiStrategy.mq5 | //| Copyright 2026, Financial Algo | //| https://mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026" #property link " https://mql5.com " #property version "1.00" #property strict //---