Convert Pinescript into MQL5 auto trading robot with minor modification

MQL5 转化中

指定

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)

反馈

1
开发者 1
等级
(55)
项目
96
40%
仲裁
13
38% / 62%
逾期
25
26%
空闲
2
开发者 2
等级
(546)
项目
823
73%
仲裁
15
53% / 13%
逾期
193
23%
工作中
3
开发者 3
等级
(8)
项目
13
38%
仲裁
0
逾期
2
15%
空闲
4
开发者 4
等级
(126)
项目
158
35%
仲裁
4
25% / 50%
逾期
13
8%
工作中
5
开发者 5
等级
(38)
项目
50
10%
仲裁
1
0% / 0%
逾期
8
16%
空闲
6
开发者 6
等级
(71)
项目
97
43%
仲裁
2
50% / 0%
逾期
2
2%
空闲
7
开发者 7
等级
(555)
项目
922
48%
仲裁
300
59% / 25%
逾期
123
13%
已载入
8
开发者 8
等级
(66)
项目
143
34%
仲裁
11
9% / 55%
逾期
26
18%
工作中
相似订单
Hello Great Developer. I have a HFT bot for mt4. Can you copy it for ctrader? I will be looking for a Great Developer to bid for it and let talk about it now
i mean i have this indicator(it's made for tradingview) but i would like to be using it in mt5, that's to change from pinescript code to mql5 code so that i can install it in mt5. and i want it be working in mt5 exactly the way its working in tradingview
Hello there, I have a script on tradingview pinescript that I need to get it converted to mql5 and add trailing loss, the script is very simple and not too complex. I will share the script with you once you bid. Thanks
This is a Ready Made grid Automatic EA 1. need some bug fixing and little modifcation this ea has some bug like -Takeing Random Trade after Mt4 Restart . also not flow set grid distance. like if i set 300pips grid distance, some time it place trade at 400 pips distance . fix this bug 2. Add one more anti-martingle Engine , LIKE Engine1-for martingle and Engine 2- Anti-martingle bot Engine place trade at the same time
Looking for a skilled developer to turn a pinescript into an MT5 indicator & EA I then want it to place buy and sell trades accordingly with close on opposite signal. // @version=1 indicator ( "Supply and Demand johann]" , overlay = true , max_boxes_count = 500 , max_bars_back = 500 ) //------------------------------------------------------------------------------ //Settings
Hello, I need to convert and indicator from pindescript to a bot in mt5 with a specific strategy. the pinescript is simple and is basicly modified moving average crossover with atr channel
Hi, I have one indicator for MT4 and it is working fine as I need. Now I want to convert it into MT5 version. The basic idea is that I put a starting date in one box, symbol in second box, number of lots in 3 box, per point value in 4th box. Indicator generate a virtual equity from starting minute till current date and time and shows it in 5th box and before this, it shows the starting price also, which I set by date
The developer needs to convert the attached ZZ semafor indicator from MQL4/MT4 platform to Pine Script, ensuring it includes alerts. hoping to get this done within a day. This involves translating the indicator's logic, including its ZigZag calculations and plotting logic, into Pine Script's syntax. Additionally, the script should generate alerts based on specific conditions or events within the indicator's behavior
Hello I have Order Flow Chart & Software Depends on Ninjatrader I want to EA a trading robot that works on different platforms via API Expert NinjaTrader Programmer for Cross-Platform Trading Robot I'm in need of a skilled NinjaTrader programmer to develop a cutting-edge trading robot that seamlessly operates across various platforms via API integration? I want a customized Expert Advisors (EAs) tailored to your
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

项目信息

预算
30+ USD
开发人员
27 USD