Hello developers,
The purpose of this indicator is to preserve value of indicator value on one Time-frame when turn chart on different TF. The underlying condition is:
if(iMA(NULL,D1,15,0,MODE_EMA,0,d1bar_1)>=iMA(NULL,D1,15,0,MODE_EMA,0,d1bar_2)) THEN value=1, else Value=-1
I knew how to do it using 1 method, named APPROACH 1 in the code. It is a bit long, especially when it come to lag value like today (D_0), yesterday (D_1)....
I am learning method 2, named APPROACH 2 which allow me simply create a value like indicator_1[I]=indicator_0[I+1]. The problem is that on H1, the [I+1] is 1 more H1 bar even though I want to preserve D1 value which associated with D1 bar.
With the help of other member, the preservation of D1 on any TF chart is done. I want you to follow exactly the same method for H4 and H1.
I try to fill in all other information, and essentially, all you need to do is to make adjustment for H4 and H1 in the below section (If I am correct).
#define HR2400 86400
int TimeOfDay(datetime when=0){ if(when == 0) when = TimeCurrent();
return( when % HR2400 ); }
datetime DateOfDay(datetime when=0){ if(when == 0) when = TimeCurrent();
return( when - TimeOfDay(when) ); }
datetime Yesterday(datetime when=0){ if(when == 0) when = TimeCurrent();
int iD1 = iBarShift(NULL, PERIOD_D1, DateOfDay(when) - 1);
return( iTime(NULL, PERIOD_D1, iD1) ); }
datetime now = Time[i],
yest = Yesterday(now);
int iYest = iBarShift(NULL,0, yest);
D1new_indi_1[i]=D1new_indi[iYest];
I attached the code itself and the MA color indicator just so you can compare the result.
Benzer siparişler
I am currently using the attached Arbitrage MACD indicator. However, there are no signal alerts associated with this indicator. I would like to receive notifications on my android device the bar after a blue long arrow appears and the bar after a red short arrow appears. This is the current code: //+------------+-----------------------------------------------------+ //| v.22.04.07 | ArrZZx2.mq4 |
: Hello, I am looking for an experienced MQL4 developer to create a custom Binary Options Trading Bot for MetaTrader 4 (MT4). The bot needs to automate trades based on clear conditions and must have a reliable integration feature. I would like the bot to work smoothly with Telegram so that it can either receive signals from a channel/group or send instant trade notifications directly to my Telegram. The code should
double GetTodayProfit() { double profit = 0; datetime today = StringToTime(TimeToString(TimeCurrent(), TIME_DATE)); HistorySelect(today, TimeCurrent()); for(int i = HistoryDealsTotal() - 1; i >= 0; i--) { ulong ticket = HistoryDealGetTicket(i); if(HistoryDealGetString(ticket, DEAL_SYMBOL) == _Symbol) { profit += HistoryDealGetDouble(ticket, DEAL_PROFIT); } } return profit; }
مطلوب موشر مع ربطه علي بوت تداول قوي جدا مختبر ومجرب مع التاكيد علي نسبه النجاح يتم انشاءه علي جميع الموشرات في الفوركس الذهب والبتكوين والus100 مع شرح للستراتيجية ونتايج اختيار اذا كان مجرب
I am looking for a developer to create an Expert Advisor (EA) for MetaTrader 5. Requirements: Trade XAUUSD (Gold) Automatically open and close trades Include Stop Loss and Take Profit settings Adjustable lot size and risk percentage Work on MT5 Allow me to change settings from the EA inputs Include backtesting support Source code preferred
I have build a trading view indicator which monitors trades. The strategy is based on OB, it buys and sells bullish and bearish OB. Also valid re enters on the retest of orderblocks only if TP is hit the first time. I’m looking for someone to develop me a EA which works on the same logic and buys and sells of the same logic as my Indicator. I currently have my indicator firing signals into a telegram channel so I
I need an expert advisor for fast excursion of trades. So that I can up my skills, I need it to have a good balance and need you to at least to price the the bot below $50
احتاج استراتيجية مع تحويله لمؤشر وفي المستقبل لربورت تداول مع وقف خسارة متحرك يعمل علي mt5وعمل علي مناطق دخول ىخروج يعمل علي الناسداك والعمل علي تقويتها باقصى نسبه نجاح بنسبه ٩٥ بالميه
Hello, I'm interested in a quote to convert my manual trading strategy into an automated strategy for NinjaTrader. Please note, I would like the quote based on the work and not my available budget; therefore, I entered $5 for the budget. Additionally, I would appreciate knowing how long it would take to build/test. I would prefer to have it sooner rather than later but selected 7 days not knowing how long it takes to
This is a privet job so I'm just filling this up with words so that I can actually open the job so main stuff has already been discussed before and you know what needs fo be done