Convert Pinescript into MQL5 auto trading robot with minor modification

MQL5 In conversione

Specifiche

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)

Con risposta

1
Sviluppatore 1
Valutazioni
(55)
Progetti
96
40%
Arbitraggio
13
38% / 62%
In ritardo
25
26%
Gratuito
2
Sviluppatore 2
Valutazioni
(550)
Progetti
827
73%
Arbitraggio
15
53% / 13%
In ritardo
193
23%
In elaborazione
3
Sviluppatore 3
Valutazioni
(8)
Progetti
13
38%
Arbitraggio
0
In ritardo
2
15%
Gratuito
4
Sviluppatore 4
Valutazioni
(130)
Progetti
166
36%
Arbitraggio
4
25% / 50%
In ritardo
13
8%
In elaborazione
5
Sviluppatore 5
Valutazioni
(38)
Progetti
50
10%
Arbitraggio
1
0% / 0%
In ritardo
8
16%
Gratuito
6
Sviluppatore 6
Valutazioni
(71)
Progetti
97
43%
Arbitraggio
2
50% / 0%
In ritardo
2
2%
Gratuito
7
Sviluppatore 7
Valutazioni
(564)
Progetti
933
47%
Arbitraggio
302
59% / 25%
In ritardo
125
13%
Caricato
8
Sviluppatore 8
Valutazioni
(66)
Progetti
143
34%
Arbitraggio
10
10% / 60%
In ritardo
26
18%
Gratuito
Ordini simili
Hello, I’m looking for an experienced coder to help with algorithm development. Specifically, I need assistance with converting a MetaTrader Expert Advisor (EA) into TradeLocker. Additionally, I would like to have a new EA built in TradeLocker that mirrors the logic of the original MetaTrader EA, including the specific rules and conditions I need. Please contact me only if you have prior experience converting scripts
Hi there, To assist with the development of an algorithm, I need a seasoned PineScript and MQL coder to convert an indicator from TradingView to MeTaTrader 4, then create an expert advisor (EA) with the same logic as the indicator and the features I want in the expert advisor (Rules & Conditions). Please only apply if you have experience converting scripts from TradingView to MQL. I also need to make sure that the
Hello, I need a coder to help with an algorithm development by converting METATRADER EA INTO TRADELOCKER then build an EA with the same logic of the METATRADER and in addition to the ideas I want in the expert advisor(Rules & Conditions) of exactly the features needed for implementation to have the expert advisor designing as my expected products, ONLY REACH OUT IF YOU HAVE BEEN CONVERTING SCRIPT FROM METATRADER TO
Hello, I need a seasoned PineScript and MQL coder to help with an algorithm development by converting an indicator on TradingView to MT4 then build an EA with the same logic of the indicator and in addition to the ideas I want in the expert advisor(Rules & Conditions) of exactly the features needed for implementation to have the expert advisor designing as my expected products, ONLY REACH OUT IF YOU HAVE BEEN
I want like to convert my tradingview indicator to mt4 EA I use 3 MA MSB RSI The list of the 4 indicators are on TradingView, 1. Market Structure Break And Order block. By EmreKb 2. TMA - Divergence Indicator (V2) 3. Multiple MA (21,50,100) 4. SuperTrend
The goal is to develop a system that mirrors trade actions (Buy/Sell) from a CTrader demo account on Cronos Markets to multiple prop firm accounts on TradeLocker, ensuring accurate replication of trades while adjusting risk proportionally. I was wondering if you could help me with copy trading an EA’s action on Cronos markets (uses CTrader) into a prop firm account that I bought with TooOne Trader (uses TradeLocker
Hello! Since last coder never finished I need to post again, please only accept if you can deliver this conversion. I want to convert an existing open source indicator for tradingview to mql5. Its an orderblock indicator also showing horizontal bullish/bearish volume. My expectation of this is the following: The orderblocks will apear on the chart at exactly the same place with top/bottom etc. The bullish and bearish
hi, I have a strategy coded in Python on Jupiter but I have trouble converting it to Quantconnect. Could you do that? The strategy is based on trading with 10 most liquid crypto coins on Binance rebalanced each month and tracking when the price break 20 day high or low plus some other indicators
Hi there, I am offering $30 usd for someone to convert four pictures I have to metatrader icons(arrows) that I can use in both MT4 & MT5. We all know that we can change arrows on the chart by using a different arrow code, but the arrows in metatrader are boring and I want to use custom ones. I want the four attached pictures as icons that i can use with indicators that give the option to choose your arrow type. I
Trade Mirroring Solution 100 - 150 USD
Hey there! I was wondering if you could help me with copy trading an EA’s action on Cronos markets (uses CTrader) into a prop firm account that I bought with TooOne Trader (uses TradeLocker to execute trades). Actually, I have 3 prop firm accounts with them that I am trying to pass with this particular EA. 1) Each of these 3 accounts is $250,000 (different account numbers that cannot be combined. 2) I currently have

Informazioni sul progetto

Budget
30+ USD
Per lo sviluppatore
27 USD