I need a simple EA program based on RVI study (calculations included). The original program was written in Thinkscript. I need that converted to MQL4

MQL4 Experts

Spécifications

Hi,  I need an EA based on the following thinkscript program. The program is simple and self explanatory. Let me know if there are any questions.  I will need the actual script of the program so that I can  modify it.  

 Thank you. 

Input RVIlength =2;

Input Investment = 1000;

input No_Share_To-Buy =  Investment /close;


def highPrice = StDev(high, 2);

def lowPrice = StDev(low, 2);
def highAvgUp = ExpAverage(if high > high[1] then highPrice else 0, RVIlength);
def highAvgDown = ExpAverage(if high < high[1] then highPrice else 0, RVIlength);
def lowAvgUp = ExpAverage(if low > low[1] then lowPrice else 0, RVIlength);
def lowAvgDown = ExpAverage(if low < low[1] then lowPrice else 0, RVIlength);
def highRVI = 100 - 100 / (300 + highAvgUp / highAvgDown);
def lowRVI = 100 - 100 / (300 + lowAvgUp / lowAvgDown);
def RVI = (highRVI + lowRVI) / 2;

 

//the following  is a simple moving average//

def AVGRVI =  (MovingAverage(data = RVI, length =RVIlength));

def AvgRVI_V = if AVGRVI[-1]-AVGRVI>0 and AVGRVI-AVGRVI[1]<0 then 1 else 0;

def AvgRVI_H = if AVGRVI[-1]-AVGRVI<0 and AVGRVI-AVGRVI[1]>0 then 1 else 0;

def AVGRVI_Slope_Up = if AVGRVI-AVGRVI[1] >0 then 1 else 0;

def AVGRVI_Slope_down = if AVGRVI-AVGRVI[1] >0 then 1 else 0; 

/////////////////////////////////////////////////////////////////////////////////////////////////////// 

//And here are the Buy to Open (BTO), Sell to Close (STC) and STO and BTC sell signals:

def BTO = if AvgRvi_Valley==1 and AVGRVI_Slope_Up==1  then 1 else 0;

def STC = if  AvgRvi_hill==1   then 1 else 0;

def STO = if AvgRvi_hill[1]==1  and AVGRVI_Slope_Down==1  then 1 else 0;

def BTC = if AvgRvi_Valley[-1]==1 then 1 else 0;

//Please note that every STO is exactly one tick after the STC and every BTO is exactly one tick following the BTC (ie, the entire pairs chart is divided into buy or sell with no gaps in between unless the sale is going in the wrong direction within 3 ticks of the purchase. In other words, if the BTO doesn't generate a profit of any amount within the first three ticks, I'd take the loss in that trade and close the position. Same thing for STO positions. That too needs to lead to a positive P&L within the first three ticks (I don't care if after the third tick it doesn't generate a positive P&L-as a matter of fact, I would like the program to disregard the P&L past the first three ticks and not to close the position). The way I programmed that in Thinkscript is to assign a Timer to keep track of the P&L within only the first three ticks of any new BTO or STO signals.  IN MQL there may be easier ways to accomplish this than in thinkscript, but the following is my explanation of my workaround this issue which may help. 

 //The following will keep track of how many ticks has passed since the position was first opened regardless of how many more open signals are generated between that time and the time this trade position is closed  

Def BTO/STO_Timer = if (BTO ==1 or STO==1) then BTO/STO_Timer[1]+1 else if (STC ==1 or BTC==1) then 0 else BTO/STO_Timer[1]+1

//the following will remember the opening price of each position regardless of how many more Open signals are generated between that time and the time this trade position is closed  

Def BTO/STO_Price = if (BTO == 1 or STO ==1)  then Close else if (STC == 1 or BTC==1) then 0 else BTO/STO_Price[1];

//the following will generate the close signals if the P&L within the first three ticks of the new position is not going in the right direction.   

def StopLoss_STC = if BTO_Price > close and BTO[3]==1 and BTO/STO_Timer[3]<3 then 1 else  0;

def StopLoss_BTC = if STO_Price < close and STO[3] ==1 and BTO_Timer[3]<2 then 1 else 0;

  /////////////////////////////////////////////////////////////////////////////////////////////////////

//Lastly I need to Generate the BTO  and STO...  signals to auto_purchase the number of units as calculated in  "No_Share_To-Buy" with the signal above,

//I  need to generate STC  signal which closes the position  with either STC or StopLoss_STC

// and  to generate BTC  signal which closes the position with either BTC or StopLoss_BTC

 

BTW, I don't care if the program is in MQL4 or MQL5. Whichever is more convenient. 

Thank You,


David 

Répondu

1
Développeur 1
Évaluation
(195)
Projets
395
28%
Arbitrage
155
20% / 52%
En retard
112
28%
Gratuit
2
Développeur 2
Évaluation
(46)
Projets
73
16%
Arbitrage
13
8% / 92%
En retard
37
51%
Gratuit
Commandes similaires
I would love to see most of my trades going well being in profits! & keep consistent trading without having to blow any accounts be able to identify right trades and have good trading strategy
Black dragon MT5 indicator. EA to take the buy and sell signal with selectable timeframe and lot size. Strategies could be either with or without martingale and with or without hedge. If you already have something similar EA ready to take this signal. Please take the work order for further discussion. Budget negotiable. Thanks. https://www.mql5.com/en/market/product/62749#!tab=overview&nbsp;
Hello, I am looking for a Filipino MQL5 (MT5) programmer who can develop a simple automated trading EA for my personal live trading account (not for prop firm use). Strategy Details: Pair: XAUUSD (Gold) only Timeframe: 1 Hour (H1) Daily range-based pending order system Fixed Stop Loss: 20.00 price movement Step trailing system (moves every +20.00 profit) Maximum 1 trade per day No martingale No grid Features
Vell 35+ USD
Advanced trading robot built on ICT concepts and structured Price Action methodology. Designed to identify liquidity zones, market structure shifts, and high-probability entries while maintaining disciplined risk management and optimized trade execution for consistent, rule-based performance
I NEED A PROFITABLE EA 50 - 150 USD
This may be a weird request but if anyone has an EA that is actually consistently profitable I want to buy a copy of the source code from you. Ideally trades a lot, I'm sure theres a coder out there who has made a profitable EA, I want to backtest if you have, I have been trying to code a few on my own with no success as I'm not yet good at coding. In the mean time I need something profitable. bonus points if it
Yash Agrawal 30+ USD
// Simple EMA Bot input int FastEMA = 9; input int SlowEMA = 21; void OnTick() { double fast = iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,0); double slow = iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,0); if(fast > slow) { if(PositionsTotal()==0) OrderSend(Symbol(),OP_BUY,0.01,Ask,10,0,0); } if(fast < slow) { if(PositionsTotal()==0) OrderSend(Symbol(),OP_SELL,0.01,Bid,10,0,0); } }
Gold robot Ga1 30 - 200 USD
mport pandas as pd import numpy as np def detecter_tendance(data): # Code pour détecter la tendance pass def identifier_niveaux(data): # Code pour identifier les niveaux de support et de résistance pass def calculer_stop_loss(tendance, support, resistance): # Code pour calculer les stop loss pass def calculer_profils(tendance, support, resistance): # Code pour calculer les profils mport pandas as pd
I need modifications and restructuring of an existing MetaTrader 5 Expert Advisor (MQL5) . The current EA works with only one filter for trade entry. I need it redesigned to support 10 optional filters , with flexible configuration and improved Renko logic. I will provide the full .mq5 source code . The EA currently opens trades only when the selected filters agree in direction. 1) 10 Optional Filters System The EA
Seeking an experienced quantitative developer to build a custom, AI-powered Telegram signal parsing and trade execution system. The goal is to automatically copy trading signals from multiple Telegram providers to MetaTrader 5 with ultra-low latency and intelligent signal interpretation. Body: Looking for an experienced developer to build a custom signal copier system. Skills Required: - MQL5 / MetaTrader 5
I need a hft bot that works well on live market. I have tested some bot and they only perform on demo market. If you have any one that is profitable in the live market, pls send a message. I will need to test it before paying. Pls make sure the bot is profitable in LIVE MARKET

Informations sur le projet

Budget
20 - 100 USD
Délais
de 1 à 3 jour(s)