Renko ATR Strategy (Info Upgrated)

MQL5 Integration Converting

Job finished

Execution time 31 days

Specification

...!!! I apologize - one of the developers sent me a ready-made version with good results...this is my first time tryingto create a robot and I deleted the previous and similar post... in order not to devalue his work, I ask the one who sent the tested strategy to contact me so that I can pay him for the work done and the ready strategy...I changed the post so many times, I apologize for that - I keep forgetting something essential, and this is important for the correct understanding and completion of the assignment.

The strategy was slightly reworked with artificial intelligence for my specific needs, here is the link to the original strategy and how it changed over time :

 ...what I want to do is:

-to convert the strategy I reworked (based on the strategy specified in the link above) so that all conditions, interaction, functions (absolutely everything that this script represents in the trading view) to be recreated 1 to 1 in formats for a valid strategy in MQL 5... that is, conditions for entering and exiting a trade, stop loss, take profit, R:R ratio, correct capital allocation, currency type and as all options for variables that exist - the way they exist in the view and in the trading view - MUST BE RE-CREATED IN MQL 5...

!!! Please note that this is the "Renko V 2" version of this strategy and it has been further refined with artificial intelligence - the desired effect is exactly the same as that of the strategy that I have published as a script below.

!!! For a better understanding of the effect I am looking for, it is best to copy my version of the strategy with my different settings in the trading view and test it there on a renko chart - this is also the effect I am looking for that I want to recreate in metatrader 5 (1 to 1) or with a very close result.
This is the strategy (my version) that I want to convert:


//@version=5
// This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/
// © dman103

strategy(title='Renko Strategy V2 settings by Lavokan', shorttitle='Renko Strategy V2 settings by Lavokan', overlay=true, precision=3, commission_value=0.025, default_qty_type=strategy.cash, default_qty_value=10000, initial_capital=10000)

// === INPUT BACKTEST RANGE ===
i_startTime = input.time(defval=timestamp('01 Dec 2014 00:00 +0000'), title='Start Time', group='Date Range')
i_endTime = input.time(defval=timestamp('31 Dec 2029 23:59 +0000'), title='End Time', group='Date Range')
time_cond = time >= i_startTime and time <= i_endTime
allow_short = input.bool(false, title='Allow Short', group='Settings')
atr_len = input.int(10, 'ATR Length', group='Settings')

// === ATR CALCULATIONS ===
atr = ta.atr(atr_len)

// === RENKO LOGIC ===
Renko1() =>
    p1 = 0.0
    p1 := close > nz(p1[1]) + atr ? nz(p1[1]) + atr : close < nz(p1[1]) - atr ? nz(p1[1]) - atr : nz(p1[1])
    p1
Renko2() =>
    p2 = 0.0
    Br_1 = Renko1()
    p2 := Renko1() != Renko1()[1] ? Br_1[1] : nz(p2[1])
    p2

Renko3() =>
    p3 = 0.0
    p3 := open > nz(p3[1]) + atr ? nz(p3[1]) + atr : open < nz(p3[1]) - atr ? nz(p3[1]) - atr : nz(p3[1])
    p3

Renko4() =>
    open_v = 0.0
    Br_2 = Renko3()
    open_v := Renko3() != Renko3()[1] ? Br_2[1] : nz(open_v[1])
    open_v

o2 = Renko4()
c2 = Renko1()

// === INPUTS FOR R:R, LEVERAGE, AND DEAL CAPITAL ===
riskRewardRatio = input.float(2.0, title="Risk-to-Reward Ratio", minval=0.1, step=0.1, tooltip="Ръчно въведете съотношение R:R (пример: 2 означава 2:1)")
leverage = input.float(1.0, title="Leverage (1x - 100x)", minval=1, maxval=100, tooltip="Въведете стойността на ливъриджа")
dealCapital = input.float(1000, title="Deal Capital (EUR)", minval=1, tooltip="Сума за единична сделка в евро")

// === POSITION SIZE CALCULATION ===
position_size = dealCapital * leverage

// === R:R FORMATTING ===
riskRewardText = str.tostring(riskRewardRatio, '#.##') + ":1"

// === TRADE CONDITIONS ===
go_long = ta.barssince(o2 < c2) < ta.barssince(o2 > c2) and o2 < c2
go_short = allow_short and ta.barssince(o2 > c2) < ta.barssince(o2 < c2) and o2 > c2

// === STOP LOSS AND TAKE PROFIT LEVELS ===
long_stop_loss = c2 - (c2 * (1 / riskRewardRatio))
long_take_profit = c2 + (c2 * riskRewardRatio)
short_stop_loss = c2 + (c2 * (1 / riskRewardRatio))
short_take_profit = c2 - (c2 * riskRewardRatio)

// === TRADE EXECUTION ===
if go_long and time_cond
    strategy.entry("Long", strategy.long, qty=position_size / close)
    strategy.exit("Long TP/SL", from_entry="Long", stop=long_stop_loss, limit=long_take_profit)

if go_short and time_cond
    strategy.entry("Short", strategy.short, qty=position_size / close)
    strategy.exit("Short TP/SL", from_entry="Short", stop=short_stop_loss, limit=short_take_profit)

// === ALERTS ===
if go_long
    alert("Long Entry at price (" + str.tostring(close) + ") - R:R: " + riskRewardText, alert.freq_once_per_bar)
if go_short
    alert("Short Entry at price (" + str.tostring(close) + ") - R:R: " + riskRewardText, alert.freq_once_per_bar)


!!! It is important to note that this strategy will work in real time independently, in automatic mode and will be used to manage a funded account, so the precision of the execution and the result of the testing and the result in general is important. Of course, I want to have the option and the ability to manually close and open trades in real time while the robot continues to work...
I would like to have manual change options:

all the assignment and settings change options that the strategy has in the trading view, so I can test in the MQL 5 strategy tester which are manual change options:

(all that are inside the strategy with change options)

!!! I will attach pictures to visualize all the options for change (some pictures do not show all, so there will be two different pictures on the same page...

The strategy will be used for trading on a one-minute chart of Bitcoin (and not only) and has been tested in Trading View on a one-minute chart of Bitcoin with the following parameters:initial capital 1000 euros, leverage 100, single amount for entering a deal 100 euros, R:R 2:1, ATR 10, maximum use of all capital of the following 30% and gives results: 50% success rate and profit coefficient over 1.5 


All options on which the strategy was tested in Trading View are the same as those depicted in the pictures I will upload.
Therefore it is desirable that it be tested first by you in Trading View with these parameters !!!

(I have also added pictures and there you can also see the settings with which the strategy was tested)

to make it clearer what result I want to create in MetaTrader 5...



The results of the backtest in MetaTrader 5 will show the level of identity of the strategy in MT5...my expectations are that the results will be identical or very close...




Responded

1
Developer 1
Rating
Projects
0
0%
Arbitration
1
0% / 0%
Overdue
0
Working
2
Developer 2
Rating
(64)
Projects
144
46%
Arbitration
19
42% / 16%
Overdue
32
22%
Free
3
Developer 3
Rating
(15)
Projects
34
24%
Arbitration
3
0% / 33%
Overdue
2
6%
Working
4
Developer 4
Rating
(839)
Projects
1433
72%
Arbitration
117
29% / 47%
Overdue
356
25%
Working
Published: 3 articles
5
Developer 5
Rating
(1)
Projects
2
0%
Arbitration
2
50% / 0%
Overdue
0
Free
6
Developer 6
Rating
(572)
Projects
943
47%
Arbitration
303
59% / 25%
Overdue
125
13%
Working

Project information

Budget
100 - 1000 USD
VAT (21%): 21 - 210 USD
Total: 121 - 1210 USD
For the developer
90 - 900 USD
Deadline
from 1 to 10 day(s)