Lua to MT4 program conversion

MQL4 Indicatori Esperti

Specifiche

I need a programmer familiar with Lua to convert an EA written in Lua (Atached) for Trading Station platform to MET4 and make some additional modifications as explained below to it: 

The new EA needs to have the following characteristics:

Option 1) EA needs to identify the High and Low price within the last X hours

EA to write down the two values found above on the active screen for manual confirmation by user and draw a horizontal line through the two values

EA Properties variable Options to include:

No of Hrs prior for Highs and Lows determination NOHPHLD

Example of high low when NOHPHLD = 20 hours


a


Option 2) Also EA need to identify the Highs and Lows in the 2 previously completed ZigZag patterns And to draw the zigzag pattern on the active instrument chart as well as a horizontal line identifying the previous completed zigzag high and low. (I have included below the code for the ZigZag pattern I obtained from the list of TD Ameritrades indicators for your review and conversion to MET4 (granted the programming language of TD Ameritrade platform is different that the trading stations, but there are enough commonalities that you could possibly use that as a template for the type of variables and parameters I'd like the ZigZag indicator to include in it)

(Properties to be included are as follow): 


If the difference between the highs and lows is less than another user defined variable by the name of "Minimum accepted high low difference", then the EA will pick the higher or the lower of the previous zig zag High and Low until the difference between the highs and lows is greater than the "Minimum accepted high low difference".

Example: in the following figure, lets say that I set the Minimum accepted high low difference as 3.0

The previously completed zigzag high and low as seen below is 113.96 and 112.04. But the difference between 113.96 - 112.04 is less than 3. Therefore, the program would go back and pick the higher high and lower of the low of the two previous completed zigzag patterns which are 115.370 and 112.02. Now the difference between those two high and lows are greater than 3. Therefore, the program uses those two figures as the highs and the lows instead for the next part of the program.  

 



Other Variables to be included for this part of the EA:

ZZ Percent Reversal

Absolute Reversal

ATR Length

ATR Reversal


 

and Option to apply ZZ to one of the following chart times

30 min

1 hour

2 hour

4 hour

 

Trend stop_Color add ons:

Property to be added to the Trend Stop_Color strategy include options to either use the High Low value obtained from Option 1 above or option 2 above

Property to include a variable called “Delta pips from high Low (DPFHL)”

Criteria: only IF the price point is within the High +/- DPFHL, or Low +/- DPFHL, Trend Stop_Color can open a new position (Trend stop can always close the position at any point). Trendstop should not be able to open a new position if the price is outside of the High +/- DPFHL or Low +/- DPFHL


Example. Lets say that after establishing that the high and low in the option 2 above was 115.370 and 112.02, I set the DPFHL at 0.6.  This means that anytime the TrendStop has an open position order within price range of 115.37 +/- 0.3 or 112.02 +/- 0.3, then it should act on that order. Otherwise it should not open the new position. So, in the example below, the EA opens a long position when the trend stop line crosses below at 112.40 and closes that position when it crosses above at 112.8, but does not open a new position again when the trendstop line crosses below at 113.2 or when it crosses above at 113.1 because those values are outside of the range defined above. 


  


Additional variables to include options to allow opening the trades at any point in time or only during one or more of the following Trading Session (times are Eastern Standard Time):

NYT: 8:00 to 16:00

London: 3:00 to 11:00

Tokyo: 19:00 to 3:00

Sydney; 17:00 to 1:00


Add Variable to trigger new trade when bar crosses above (long position) or crosses below (short position) the Trendstop line or when the bar closes above or below the trendstop line.

 

Last thing to be added is with regards to the amount to be traded. Id like the EA to be able to break the dollar amount of the trades into multiple smaller orders, executed at X seconds from each other: (for example, if I am sending an order for 1 million, I'd like to be able to break down the orders by a factor of 10 (variable to be added)  or 1 Lot per order, submitted to the broker within a second of each other.  When closing the trades, all lots to be closed at the same time  

Variable to be included: Trade size:

Trade broken down by a factor of:   

Trades executed within how many seconds of one another:




And here is the code to the Zig Zag indicator on TD Ameritrade to model after: 
 input priceH = high;

input priceL = low;

input percentageReversal = 5.0;

input absoluteReversal = 0.0;

input atrLength = 5;

input atrReversal = 1.5;

 

Assert(percentageReversal >= 0, "'percentage reversal' must not be negative: " + percentageReversal);

Assert(absoluteReversal >= 0, "'absolute reversal' must not be negative: " + absoluteReversal);

Assert(atrReversal >= 0, "'atr reversal' must not be negative: " + atrReversal);

Assert(percentageReversal != 0 or absoluteReversal != 0 or atrReversal != 0, "Either 'percentage reversal' or 'absolute reversal' or 'atr reversal' must not be zero");

 

def hlPivot;

if (atrReversal != 0) {

    hlPivot = percentageReversal / 100 + WildersAverage(TrueRange(high, close, low), atrLength) / close * atrReversal;

} else {

    hlPivot = percentageReversal / 100;

}

def state = {default init, undefined, uptrend, downtrend};

def maxPriceH;

def minPriceL;

def newMax;

def newMin;

 

def prevMaxH = GetValue(maxPriceH, 1);

def prevMinL = GetValue(minPriceL, 1);

 

if GetValue(state, 1) == GetValue(state.init, 0) {

    maxPriceH = priceH;

    minPriceL = priceL;

    newMax = yes;

    newMin = yes;

    state = state.undefined;

} else if GetValue(state, 1) == GetValue(state.undefined, 0) {

    if priceH >= prevMaxH {

        state = state.uptrend;

        maxPriceH = priceH;

        minPriceL = prevMinL;

        newMax = yes;

        newMin = no;

    } else if priceL <= prevMinL {

        state = state.downtrend;

        maxPriceH = prevMaxH;

        minPriceL = priceL;

        newMax = no;

        newMin = yes;

    } else {

        state = state.undefined;

        maxPriceH = prevMaxH;

        minPriceL = prevMinL;

        newMax = no;

        newMin = no;

    }

} else if GetValue(state, 1) == GetValue(state.uptrend, 0) {

    if priceL <= prevMaxH - prevMaxH * hlPivot - absoluteReversal {

        state = state.downtrend;

        maxPriceH = prevMaxH;

        minPriceL = priceL;

        newMax = no;

        newMin = yes;

    } else {

        state = state.uptrend;

        if (priceH >= prevMaxH) {

            maxPriceH = priceH;

            newMax = yes;

        } else {

            maxPriceH = prevMaxH;

            newMax = no;

        }

        minPriceL = prevMinL;

        newMin = no;

    }

} else {

    if priceH >= prevMinL + prevMinL * hlPivot + absoluteReversal {

        state = state.uptrend;

        maxPriceH = priceH;

        minPriceL = prevMinL;

        newMax = yes;

        newMin = no;

    } else {

        state = state.downtrend;

        maxPriceH = prevMaxH;

        newMax = no;

        if (priceL <= prevMinL) {

            minPriceL = priceL;

            newMin = yes;

        } else {

            minPriceL = prevMinL;

            newMin = no;

        }

    }

}

 

def barNumber = BarNumber();

def barCount = HighestAll(If(IsNaN(priceH), 0, barNumber));

def newState = GetValue(state, 0) != GetValue(state, 1);

def offset = barCount - barNumber + 1;

def highPoint = state == state.uptrend and priceH == maxPriceH;

def lowPoint = state == state.downtrend and priceL == minPriceL;

 

def lastH;

if highPoint and offset > 1 {

    lastH = fold iH = 1 to offset with tH = priceH while !IsNaN(tH) and !GetValue(newState, -iH) do if GetValue(newMax, -iH) or iH == offset - 1 and GetValue(priceH, -iH) == tH then Double.NaN else tH;

} else {

    lastH = Double.NaN;

}

 

def lastL;

if lowPoint and offset > 1 {

    lastL = fold iL = 1 to offset with tL = priceL while !IsNaN(tL) and !GetValue(newState, -iL) do if GetValue(newMin, -iL) or iL == offset - 1 and GetValue(priceL, -iL) == tL then Double.NaN else tL;

} else {

    lastL = Double.NaN;

}

 

plot ZZ;

if barNumber == 1 {

    ZZ = fold iF = 1 to offset with tP = Double.NaN while IsNaN(tP) do if GetValue(state, -iF) == GetValue(state.uptrend, 0) then priceL else if GetValue(state, -iF) == GetValue(state.downtrend, 0) then priceH else Double.NaN;

} else if barNumber == barCount {

    ZZ = if highPoint or state == state.downtrend and priceL > minPriceL then priceH else if lowPoint or state == state.uptrend and priceH < maxPriceH then priceL else Double.NaN;

} else {

    ZZ = if !IsNaN(lastH) then lastH else if !IsNaN(lastL) then lastL else Double.NaN;

}

ZZ.SetDefaultColor(GetColor(1));

ZZ.EnableApproximation();

  

 

Con risposta

1
Sviluppatore 1
Valutazioni
(119)
Progetti
127
41%
Arbitraggio
3
33% / 67%
In ritardo
0
Gratuito
2
Sviluppatore 2
Valutazioni
(68)
Progetti
78
27%
Arbitraggio
13
31% / 54%
In ritardo
15
19%
In elaborazione
3
Sviluppatore 3
Valutazioni
(4)
Progetti
12
42%
Arbitraggio
0
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(28)
Progetti
47
23%
Arbitraggio
13
31% / 15%
In ritardo
12
26%
Gratuito
5
Sviluppatore 5
Valutazioni
(219)
Progetti
370
42%
Arbitraggio
145
17% / 41%
In ritardo
124
34%
Gratuito
6
Sviluppatore 6
Valutazioni
(121)
Progetti
134
66%
Arbitraggio
36
25% / 56%
In ritardo
22
16%
Gratuito
7
Sviluppatore 7
Valutazioni
(101)
Progetti
136
36%
Arbitraggio
14
29% / 50%
In ritardo
15
11%
Gratuito
8
Sviluppatore 8
Valutazioni
(80)
Progetti
117
67%
Arbitraggio
16
25% / 13%
In ritardo
12
10%
Gratuito
9
Sviluppatore 9
Valutazioni
(91)
Progetti
144
38%
Arbitraggio
67
15% / 48%
In ritardo
55
38%
Gratuito
10
Sviluppatore 10
Valutazioni
(130)
Progetti
210
40%
Arbitraggio
90
20% / 43%
In ritardo
85
40%
Gratuito
11
Sviluppatore 11
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
Ordini simili
Zzz 30+ USD
// กำหนดค่าตัวแปรพื้นฐาน input double lotSize = 0.1; // ขนาดล็อตที่ต้องการ input int takeProfit = 50; // ระยะ Take Profit (จุด) input int stopLoss = 50; // ระยะ Stop Loss (จุด) input int magicNumber = 123456; // หมายเลข Magic Number input int smaPeriod = 14; // ช่วงเวลา Simple Moving Average (SMA) // เวลาที่ออเดอร์ล่าสุดถูกเปิด datetime lastOrderTime = 0; // ฟังก์ชั่นหลักของ EA void OnTick() { //
Mobile robot 50 - 100 USD
I want a profitable scalping EA robot for mt5 and mobile phones (licence key should be provided).the video link attached below indicates how the EA robot should operate it.it analyses the market before taking trades and it trades candle to candle .also coding samples are provided on the video .it should be applicable to all timeframes.it should trade indices(Nas100,US30,S&p500,GER30,)
I use the translator I hope to make myself understood. I'm looking for a cyclical indicator. mt5. I attach videos to understand how it works. to be inserted at any point of the graph. It is possible to change the color and thickness of the line
This EA must have the following functions together: BE: place BE when the price reach a certain gain in PIPS and you can choose the offset too, so, for example it activates after 10 pips with 1 pip of offset so you can have profit with BE too Auto SL and TP Can manage the trades made by phone when MT5 is open in the PC or VPS Trailing stop (step by step): I can decide at what number of pips the trailing stop get
This is a strategy based on crossing two trend indicators on the second timeframe (1s, for example). We work not only with the market but with the limit orders as well (robot must "read" an order book). Read the whole instruction please for more details. Speak Russian, English
Martingale EA for MT5 30 - 100 USD
Criteria: Only one trade at a time. Cannot open another trade if one is running Trade on EURUSD only, once job is completed I will be happy to schedule more for other pairs You choose entry strategy and criteria win rate must be above 50% in long term backtest of EURUSD Every trade has got TP and SL Trades to last about a day, few trades a week, at least 10 pips gain per trade, so that it can be launched on normal
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
Im looking for an coder to code an EA: Trade management 1. opening trades according to the indicator 2. trades settings to choose from like: open all trades according to the signal open only trade 1,2,3 or 4 % per trade ( example 50/30/20 of the lot settings, with 4 trades it would be for example 50/30/10/10) 3. SL/Trailing settings: Move SL to entry after hitting TP1/TP2 or TP3 moving SL by % keep the original SL
Hi I'm looking to have 2 of my pinescript strategies converted to MQL5 and was wondering if you could first give me a quote for the more simple strategy and then for both the simple and complex strategy together. The simple strategy is a MACD crossover type thing that uses a special EMA script that filters out some ranging price action and also fractal candles for the stop loss. The second strategy is market

Informazioni sul progetto

Budget
2000 - 5000 USD
Per lo sviluppatore
1800 - 4500 USD
Scadenze
da 7 a 21 giorno(i)