Simple multi-Time Frame conversion

MQL4 Göstergeler

İş Gereklilikleri

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.


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(4)
Projeler
7
43%
Arabuluculuk
5
0% / 60%
Süresi dolmuş
3
43%
Serbest
Yayınlandı: 1 kod
2
Geliştirici 2
Derecelendirme
(34)
Projeler
80
34%
Arabuluculuk
13
31% / 54%
Süresi dolmuş
19
24%
Serbest
Benzer siparişler
Hello, I'm currently seeking a skilled and reliable MQL4 developer to assist in modifying and enhancing my Expert Advisor, Reversal Master V10.1 , to its next version V12.1 FF . This update involves integrating several advanced third-party indicators and implementing new trading logic based on clearly defined conditions to improve performance and strategy precision. If you have experience in EA development and enjoy
Project Description: I am looking for a highly skilled MQL5 developer to create a robust solution for a persistent TLS handshake failure. My Expert Advisor (EA) needs to connect to a secure WebSocket server ( wss:// ) hosted on Railway.app or any other online websocket provider, but the connection consistently fails during the security negotiation phase. Ideal Candidate Skills: Deep expertise in MQL5 programming
i am looking for an indicator that gives buy sell signal by placing arrows on the chart, signals must not repaint or be placed with an offset, i want it to be accurate enough so i can trade from signal to signal and actually make profit, do any one have a strategy and skill to create such an indicator, and also it is to mql5, ( Important is, It must have No repainting and No offset ), if you know it is something you
Trading Ea 30+ USD
hi, i wish to make an EA which generates trades from my indicator signals. and the EA should also have risk parameters and news features. I will also need some input from you to add reversal/breakout/volatiltiy expansion entry points
hello dear developer I'm looking for a NinjaTrader developer to create a semi-automated trading strategy that enters trades based on visual text signals from my custom indicator. The strategy should handle automatic entries, allow manual management after entry, and include configurable settings like TP, SL, and trading time. If you're experienced with NinjaTrader and strategy development, feel free to reach out
I need a skilled Pine Script developer to finalize and fix a Pine Script v5 strategy that was converted from TradeStation EasyLanguage using AI. The script is mostly complete but has logic issues, missing buy/sell signals, and lacks proper exits and risk control. The project involves cleaning it up and building two working scripts: 1. A TradingView Strategy (backtest-ready, includes full entry/exit logic and risk
I'm looking for an experienced Pine Script developer to help fix, enhance, and finalize a strategy converted from TradeStation EasyLanguage into Pine Script v5 for TradingView. The current script (pivot trend system) has been partially converted using AI but still contains errors and lacks full signal plotting and strategy functionality. The job involves: 1. Debugging and cleaning the existing Pine Script code 2
Hi there, I am looking for someone with experience to help me to code the indicators listed bellow. I need the to be coded in a specific way I will provide OOP template. There are 7 to 8 indicators. Mainly they have filtering which needs to be added. Thanks
Preciso de uma tabela dinâmica para monitorar até 9 pares de Forex usando meu indicador VWAP de 6 bandas no TradingView. Requisitos: - A tabela deve mostrar em tempo real quando o preço ultrapassa a penúltima banda (entre as duas últimas bandas). - As bandas são codificadas por cores (com base nas seleções de cores) e devem mudar de cor conforme a banda tocada/ultrapassada. - A tabela não deve manter histórico
Hello great developer am looking for developer that can help me with following requirement, if so mentioned time and quote. https://docs.google.com/spreadsheets/d/1UWbZ2TBIM_8SSmUTMskDiewlkGjIPioEAFHKiOEt6b0/edit?gid=1296176961#gid=1296176961 check the attach link to check the full description there i will be looking for great developer that will bid for this job

Proje bilgisi

Bütçe
10 - 15 USD
Geliştirici için
9 - 13.5 USD
Son teslim tarihi
from 1 to 2 gün