Simple multi-Time Frame conversion

MQL4 Индикаторы

Техническое задание

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

//---THIS SECTION IS FOR D1 CONVERISIOn-------------------------------------------------------------
//-this section is to make sure that on NON_D1 chart, value of D1 still "preserve and spread"
#define HR2400 86400       // 24 * 3600 = PERIOD_D1 * 60
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) ); }
//--------------------------------------------------------------------------------------------------


//lag operation
   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.


Файлы:

Откликнулись

1
Разработчик 1
Оценка
(4)
Проекты
7
43%
Арбитраж
5
0% / 60%
Просрочено
3
43%
Свободен
2
Разработчик 2
Оценка
(34)
Проекты
80
34%
Арбитраж
13
31% / 54%
Просрочено
19
24%
Свободен
Похожие заказы
BUY AND SELL 30+ USD
Create an Expert Advisor that collaborates between these indicators ETR, MEv2 and STLv3 with these features 1. SL and TP 2. TIME FILTER 3. ETR, MEv2 and STLv3 PARAMETERS BUY ENTRY STEP 1. FIRST candle OPEN above Symphonie Trend Line STEP 2. Check Symphonie Extreme must indicate color BLUE STEP 3. Check Symphonie Emotion must indicate color BLUE STEP 4. Open trade with money management STEP 5. Trade open MUST BE 1
Hello, I have a protected Ninja trader Order Flow indicator and I was wondering if you can reverse engineer it to replicate the functionality. H ere are the specifications and indicator: https://docs.google.com/document/d/1KyYwQ7iTL2KWGhnZzxS1gObccu9LPMrGuMc9Mdk_3KY/edit?usp=sharing
I have an EA that need some changes including integrating the indicator code directly into the Expert Advisor. I will give the detailed doc once we settle on the candidate for the job . Please bid if you can work with the stated amount. Thanks
Hello, Need to convert Tradingview Indicator to MQL4 indicator. or if you have this one converted already, let me buy a copy please. If we're good, then will definitely buy it and ask to convert into EA on new order. Supertrend by KivancOzbilgic
Fix bug or modify an existing Trading view indicator to display correct. The indicator is working but not displaying/plotting all the information i want. So i want it adjusted to plot all the info
Here's a brief requirement you can use: **Description:** I am seeking an experienced MQL5 developer to create a (EA). The EA should include features for placing pending orders (Buy Stop and Sell Stop) based on market spread, managing trades effectively at the opening of new candlesticks, and implementing take profit and stop loss strategies. Additionally, I would like the option to adjust parameters based on market
I have an EA which i need to do below modifications. Variable Inputs to be added Order Type : Market , Pending Trade Type : Buy, Sell , Buy & Sell Pending Pips Step : ( Pips Value can be negative or positive to decide on what type of Pending Order ) // If trade type Buy is selected Close Type : Close All ( Bulk Close Option in MT5 ) , Close Individually Close Option : %of Equity , %of Balance , Amount $ , %of No
Add multiplier to grid recovery system. For example: Grid Trade 2-3 Spacing; 1.0 Multiplier Grid Trade 4-6 Spacing; 2.0 Multiplier Grid Trade 7+ Spacing; 1.6 Multiplier Need quick turn around. Need it done ASAP
Objects reader PIN 70 - 100 USD
Hi I have an indicator that create objects in the chart and using those following some rules the new indicator will create external global variables with value = 0 ( NONE ), = 1 ( BUY ) or = 2 ( SELL ). The global variable will use PIN external integer number . PINS are by now global variables (GV) whose name indicates the pair name and the PIN belonging and their value indicates it direction/action. PINS GV names
I want an indicator and its source code that returns the value of: - two moving averages in different selectable timeframes, with method Exponential and price calculation price_open; - Opening, closing, maximum and minimum of the candle in different timeframes And that returns the values ​​regardless in a chart of one minute. The input parameters: * select timeframe media1 = {1,2,3,4,5,...} * select timeframe media2

Информация о проекте

Бюджет
10 - 15 USD
Исполнителю
9 - 13.5 USD
Сроки выполнения
от 1 до 2 дн.