Modification of Existing EA | Adding OR/ELSE IF Functions to Existing EA.

仕事が完了した

実行時間9 日
依頼者からのフィードバック
A pleasure to work with, very patient and understanding & would have no problem working with Maxwell again.
開発者からのフィードバック
I appreciate and am honored working with you. I look forward to more endeavors. Thank you.

指定

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(.....);

         /*----------code----------*/   
        /*----------code----------*/    
        /*----------code----------*/    

         }

}

ファイル:

PNG
Slide1.PNG
15.5 Kb
PNG
Slide2.PNG
15.7 Kb

応答済み

1
開発者 1
評価
(169)
プロジェクト
204
30%
仲裁
25
40% / 44%
期限切れ
12
6%
2
開発者 2
評価
(3)
プロジェクト
4
0%
仲裁
2
0% / 100%
期限切れ
1
25%
3
開発者 3
評価
(155)
プロジェクト
239
70%
仲裁
3
67% / 33%
期限切れ
20
8%
4
開発者 4
評価
(208)
プロジェクト
310
34%
仲裁
59
36% / 39%
期限切れ
100
32%
仕事中
5
開発者 5
評価
(294)
プロジェクト
469
39%
仲裁
102
40% / 24%
期限切れ
77
16%
取り込み中
パブリッシュした人: 2 codes
6
開発者 6
評価
(5)
プロジェクト
11
18%
仲裁
0
期限切れ
3
27%
7
開発者 7
評価
(42)
プロジェクト
47
30%
仲裁
12
17% / 75%
期限切れ
6
13%
類似した注文
Hi I would like to create an ea based on a product in mql5 marketplace. The previous freelancer is unable to do this due to the buffers are hidden.It is a simple arrow indicator.I want trade buy when arrow points up,trade sell when arrow points down. Leave a space for me to input lot number
Multi-Asset AI Trading Bot Details Proposals I want a single, cohesive AI bot that can log in to MetaTrader, Coinbase, Robinhood, and TradingView, scan live market data, and execute trades automatically in stocks, forex, and crypto. The core logic must support day-trading, swing-trading, and scalping modes that I can toggle on a schedule or by simple configuration. The workflow I picture is: • Real-time data
I need someone that is able to develop for me a MT5 EA that perform VERY WELL on XAUUSD. Every strategy is accepted. By applying, please send me screenshot of results since 2018
Hello developers, I'm looking for existing, proven EAs (MQL5) that work flawlessly on MT5. Requirements: Demo version available for testing Backtest results + screenshots Verified trade history from 2018-2025 Budget is negotiable If you've got an EA that fits, hit me up
cần người tạo EA y thay đổi hình ảnh gửi đầy đủ tính năng như hình giá cả có thể tăng thêm khối lượng mong muốn viết giống hình không khác ROBOT HƠI NHIỀU TÍNH NĂNG MỌI NGƯỜI CÓ THỂ ĐƯA GIÁ THAM KHẢO
I want to develop and EA first to use for back testing, then to use for trading. This will be done on the 15 min timeframe. The EA must Identify sessions highs and lows with specific timings (Asian, London, NY), Place three EMA and ensure that the 50, 100 and 200 exponential moving averages are in order to give directional bias Sell bias = 50 below the 100, which is below the 200 Buy bias = 50 above the 100, which is
I need an experienced MQL4 developer to build a robust, conservative MT4 EA designed to trade Forex major pairs on IG . This is for long-term use with controlled drawdown — no martingale/grid/hedging . Platform / Broker Platform: MT4 Broker: IG Must work with: 5-digit pricing, variable spreads, slippage, and IG’s execution constraints Symbols (Majors only) EURUSD, GBPUSD, USDJPY, AUDUSD, USDCHF, USDCAD (configurable
Need a HFT scalping EA 30 - 100 USD
Require the development of a high-speed HFT, fully automated trading Expert Advisor (EA) for MetaTrader 5 , optimized for live trading on both Deriv and Exness . The EA must be designed for fast execution, low latency, and reliability on real-money accounts , with full compatibility across broker-specific contract specifications, tick sizes, tick values, pricing formats, and volume rules. It should automatically
This EA uses the inbuilt indicators to execute trades. It follows the simple rules of buy signal and sell signal.It will be independent of each other. The same rule follows for each
Hello Developers, I need a utility that allows to me open multiple positions. First the utility will show me all currency pairs on the watch list, and it will give me the option to either buy, sell, or neutral for each currency pair. Secondly, lot sizes for all currency pairs (that are not neutral) are determined through an input of cost per pip (USD). Lastly, then the execute button, which opens positions according

プロジェクト情報

予算
30+ USD