Convert Pinescript into MQL5 auto trading robot with minor modification

MQL5 Convertir

Spécifications

Below is the script I want to convert to MT5 the only addition is that I want to add a way to each time trade the maximum of my balance or the amount traded must go up with the amount of the 


//@version=2


strategy(title = "Strategy Code Example", shorttitle = "Strategy Code Example", overlay = true, pyramiding = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 10, currency = currency.GBP)

//
// *** THIS IS JUST AN EXAMPLE OF STRATEGY RISK MANAGEMENT CODE IMPLEMENTATION ***

// === GENERAL INPUTS ===
// short ma
maFastSource   = input(defval = open, title = "Fast MA Source")
maFastLength   = input(defval = 14, title = "Fast MA Period", minval = 1)
// long ma
maSlowSource   = input(defval = open, title = "Slow MA Source")
maSlowLength   = input(defval = 21, title = "Slow MA Period", minval = 1)

// === STRATEGY RELATED INPUTS ===
tradeInvert     = input(defval = false, title = "Invert Trade Direction?")
// the risk management inputs
inpTakeProfit   = input(defval = 1000, title = "Take Profit", minval = 0)
inpStopLoss     = input(defval = 200, title = "Stop Loss", minval = 0)
inpTrailStop    = input(defval = 200, title = "Trailing Stop Loss", minval = 0)
inpTrailOffset  = input(defval = 0, title = "Trailing Stop Loss Offset", minval = 0)

// === RISK MANAGEMENT VALUE PREP ===
// if an input is less than 1, assuming not wanted so we assign 'na' value to disable it.
useTakeProfit   = inpTakeProfit  >= 1 ? inpTakeProfit  : na
useStopLoss     = inpStopLoss    >= 1 ? inpStopLoss    : na
useTrailStop    = inpTrailStop   >= 1 ? inpTrailStop   : na
useTrailOffset  = inpTrailOffset >= 1 ? inpTrailOffset : na

// === SERIES SETUP ===
/// a couple of ma's..
maFast = ema(maFastSource, maFastLength)
maSlow = ema(maSlowSource, maSlowLength)

// === PLOTTING ===
fast = plot(maFast, title = "Fast MA", color = green, linewidth = 2, style = line, transp = 50)
slow = plot(maSlow, title = "Slow MA", color = red, linewidth = 2, style = line, transp = 50)

// === LOGIC ===
// is fast ma above slow ma?
aboveBelow = maFast >= maSlow ? true : false
// are we inverting our trade direction?
tradeDirection = tradeInvert ? aboveBelow ? false : true : aboveBelow ? true : false

// === STRATEGY - LONG POSITION EXECUTION ===
enterLong() => not tradeDirection[1] and tradeDirection // functions can be used to wrap up and work out complex conditions
exitLong() => tradeDirection[1] and not tradeDirection
strategy.entry(id = "Long", long = true, when = enterLong()) // use function or simple condition to decide when to get in
strategy.close(id = "Long", when = exitLong()) // ...and when to get out
// === STRATEGY - SHORT POSITION EXECUTION ===
enterShort() => tradeDirection[1] and not tradeDirection
exitShort() => not tradeDirection[1] and tradeDirection
strategy.entry(id = "Short", long = false, when = enterShort())
strategy.close(id = "Short", when = exitShort())

// === STRATEGY RISK MANAGEMENT EXECUTION ===
// finally, make use of all the earlier values we got prepped
strategy.exit("Exit Long", from_entry = "Long", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)
strategy.exit("Exit Short", from_entry = "Short", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)

Répondu

1
Développeur 1
Évaluation
(55)
Projets
96
40%
Arbitrage
13
38% / 62%
En retard
25
26%
Gratuit
2
Développeur 2
Évaluation
(546)
Projets
823
73%
Arbitrage
15
53% / 13%
En retard
193
23%
Gratuit
3
Développeur 3
Évaluation
(8)
Projets
13
38%
Arbitrage
0
En retard
2
15%
Gratuit
4
Développeur 4
Évaluation
(126)
Projets
158
35%
Arbitrage
4
25% / 50%
En retard
13
8%
Gratuit
5
Développeur 5
Évaluation
(38)
Projets
50
10%
Arbitrage
1
0% / 0%
En retard
8
16%
Gratuit
6
Développeur 6
Évaluation
(71)
Projets
97
43%
Arbitrage
2
50% / 0%
En retard
2
2%
Gratuit
7
Développeur 7
Évaluation
(555)
Projets
922
48%
Arbitrage
300
59% / 25%
En retard
123
13%
Chargé
8
Développeur 8
Évaluation
(66)
Projets
143
34%
Arbitrage
10
10% / 60%
En retard
26
18%
Travail
Commandes similaires
Hey there, I need to convert an indicator from ninja to mt4 I will attach the ninjatrader indicator script to be converted into mt4 If you can do this kindly bid and let's discuss about the project Thanks
Hello, I need a developper to convert my Pine Script strategy to MQL5 because I need to do grid search backtesting It's a quite simple strategy, 2 ema, and depending on the position of the curve relative to those 2 ema (a percentage over or under) it selects a branch in which a red 1mn candle closing price settled at a certain percentage triggers a sell and a green 1mn candle triggers a buy, always 100% equity, easy
Seeking assistance to covert Pine script from TradingView to MetaTrader 5. Require seamless transition for optimal functionality. Appreciate expertise in script conversion. Contact for further details Expertly convert Pine script from TradingView to MetaTrader 5 with precision and efficiency. Ensure seamless functionality and compatibility for optimal trading experience. Experienced in script conversion, I guarantee
Programmer needed to make my HFT bot more suitable for live trading. After testing and proven, if up to expectation, full funds will be received. Genuine offer but if this is successful further discussions can take place. DM me first so we can discuss further
I have a Trading View Strategy which is working well. Now, i want to Convert my trading platform to Meta trader. I need an Experienced Expert for Conversion. If this sounds as something that interest you, you can respond to my message
I want to convert pinescript strategy to Metatrader 5. I'm seeking expert MT5 developer to convert my Pine Script strategy to MT5. I have the strategy working perfectly on my Tradinggview and I want it to be working perfectly on MQL5. Experience with both Pine Script and MT5 required
I currently possess a highly effective MT4 indicator that functions flawlessly within my trading strategy. However, I am eager to extend its functionality by adapting it into an expert advisor compatible with the MT5 platform. This transition would empower me to automate my trading decisions and capitalize on opportunities across both platforms seamlessly.If you possess the expertise to facilitate this conversion
Description of the work to be done: Two tradingview scripts (3rd Wave and Zigzag) from the creator Lonesometheblue will need to be converted to a single EA for mt4. This EA must consist of the indicator that implements these two tradingview and also be capable of placing the orders that the indicator alerts you to. Description of the indicator: The mt4 indicator must have the same configurable parameters as that of
Trend killer 30 - 200 USD
I Will thanks for allowing me to create and that's good for me and u thanks u very muchand I Will make a good job to work and no to scheme people
Hello Good evening, I would like to convert an MT4 indicator to MT5. Is this possible? I will send you a screenshot of how the indicator works. It has up and down arrows. that's all. What is your cost for labor and delivery time

Informations sur le projet

Budget
30+ USD
Pour le développeur
27 USD