Convert PineScript V3 to MQL5

指定

//@version=3
//

strategy(title = "JustAmhas 3S2", shorttitle = "JustAmhas 3S1", overlay=true, pyramiding=0, default_qty_value=1, commission_value=0.05)


// === INPUTS ===
useRes      = true
intRes      = input(defval = 2,    title = "Multiplier for Alernate Resolution")
stratRes    = ismonthly? tostring(interval*intRes,"###M") : isweekly? tostring(interval*intRes,"###W") : isdaily?  tostring(interval*intRes,"###D") : isintraday ? tostring(interval*intRes,"####") : '60'
basisType   = input(defval = "TEMA", title = "MA Type: ", options=["DEMA","EMA", "TEMA", "WMA", "VWMA", "HullMA", "LSMA", "ALMA", "TMA", "SSMA"])
basisLen    = input(defval = 8, title = "MA Period", minval = 1)
offsetSigma = input(defval = 6, title = "Offset for LSMA / Sigma for ALMA", minval = 0)
offsetALMA  = input(defval = 0.85, title = "Offset for ALMA", minval = 0, step = 0.01)
delayOffset = 0

// Constants colours that include fully non-transparent option.
green100 = #008000FF
lime100  = #00FF00FF
red100   = #FF0000FF
blue100  = #0000FFFF
aqua100  = #00FFFFFF
darkred100 = #8B0000FF
gray100 = #808080FF

// === BASE FUNCTIONS ===
// Returns MA input selection variant, default to SMA if blank or typo.
variant(type, src, len, offSig, offALMA) =>
    v1 = sma(src, len)                                                  // Simple
    v2 = ema(src, len)                                                  // Exponential
    v3 = 2 * v2 - ema(v2, len)                                          // Double Exponential
    v4 = 3 * (v2 - ema(v2, len)) + ema(ema(v2, len), len)               // Triple Exponential
    v5 = wma(src, len)                                                  // Weighted
    v6 = vwma(src, len)                                                 // Volume Weighted
    v7 = 0.0
    v7 := na(v7[1]) ? sma(src, len) : (v7[1] * (len - 1) + src) / len    // Smoothed
    v8 = wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))   // Hull
    v9 = linreg(src, len, offSig)                                       // Least Squares
    v10 = alma(src, len, offALMA, offSig)                               // Arnaud Legoux
    v11 = sma(v1,len)                                                   // Triangular (extreme smooth)
    // SuperSmoother filter
    // © 2013  John F. Ehlers
    a1 = exp(-1.414*3.14159 / len)
    b1 = 2*a1*cos(1.414*3.14159 / len)
    c2 = b1
    c3 = (-a1)*a1
    c1 = 1 - c2 - c3
    v12 = 0.0
    v12 := c1*(src + nz(src[1])) / 2 + c2*nz(v12[1]) + c3*nz(v12[2])
    type=="EMA"?v2 : type=="DEMA"?v3 : type=="TEMA"?v4 : type=="WMA"?v5 : type=="VWMA"?v6 : type=="SMMA"?v7 : type=="HullMA"?v8 : type=="LSMA"?v9 : type=="ALMA"?v10 : type=="TMA"?v11: type=="SSMA"?v12: v1

// security wrapper for repeat calls
reso(exp, use, res) => use ? security(tickerid, res, exp, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on) : exp


// === SERIES SETUP ===
closeSeries     = variant(basisType, close[delayOffset], basisLen, offsetSigma, offsetALMA)
openSeries      = variant(basisType, open[delayOffset], basisLen, offsetSigma, offsetALMA)


// === PLOTTING ===

// Get Alternate resolution Series if selected.
closeSeriesAlt = reso(closeSeries, useRes, stratRes)
openSeriesAlt = reso(openSeries, useRes, stratRes)
trendColour = (closeSeriesAlt > openSeriesAlt) ? green : red

bcolour     = (closeSeries > openSeriesAlt) ? lime100 : red100
closeP=plot(closeSeriesAlt, title = "Close Series", color = trendColour, linewidth = 2, style = line, transp = 20)
openP=plot(openSeriesAlt, title = "Open Series", color = trendColour, linewidth = 2, style = line, transp = 20)

fill(closeP,openP,color=trendColour,transp=80)


// === ALERT condition 1
xlong       = crossover(closeSeriesAlt, openSeriesAlt)
xshort      = crossunder(closeSeriesAlt, openSeriesAlt)

longCond    = xlong   // alternative: longCond[1]? false : (xlong or xlong[1]) and close>closeSeriesAlt and close>=open
shortCond   = xshort  // alternative: shortCond[1]? false : (xshort or xshort[1]) and close<closeSeriesAlt and close<=open

ebar            = 10000
dummy           = false

//
// Calculate how many mars since last bar
tdays       = (timenow-time)/60000.0  // number of minutes since last bar
tdays       := ismonthly? tdays/1440.0/5.0/4.3/interval : isweekly? tdays/1440.0/5.0/interval : isdaily? tdays/1440.0/interval : tdays/interval // number of bars since last bar

//set up exit parameters
TP = 200
SL = 200

// Make sure we are within the bar range, Set up entries and exit conditions
if (ebar==0 or tdays<=ebar)
    strategy.entry("long", strategy.long, when=longCond==true)
    strategy.entry("short", strategy.short, when=shortCond==true)
    strategy.close("long", when = shortCond==true)
    strategy.close("short", when = longCond==true)
    strategy.exit("exit", from_entry = "long", profit = TP, loss = SL)
    strategy.exit("exit", from_entry = "short", profit = TP, loss = SL)



応答済み

1
開発者 1
評価
(300)
プロジェクト
450
65%
仲裁
5
40% / 0%
期限切れ
4
1%
2
開発者 2
評価
(30)
プロジェクト
55
22%
仲裁
12
67% / 8%
期限切れ
2
4%
3
開発者 3
評価
(409)
プロジェクト
537
75%
仲裁
9
44% / 0%
期限切れ
24
4%
仕事中
4
開発者 4
評価
(4)
プロジェクト
6
0%
仲裁
4
25% / 75%
期限切れ
0
5
開発者 5
評価
(4)
プロジェクト
4
0%
仲裁
2
0% / 100%
期限切れ
1
25%
6
開発者 6
評価
(564)
プロジェクト
933
47%
仲裁
302
59% / 25%
期限切れ
125
13%
取り込み中
類似した注文
Personnal programmer 30 - 31 USD
Hey there! I’m looking for a talented NinjaTrader programmer to partner with on some exciting projects. If you have a knack for NinjaScript and a passion for trading tech, let’s team up! What You Can Expect: A friendly collaboration on diverse projects Fair pay—50/50 split on all earnings An opportunity to dive deep into innovative trading strategies What I’m Hoping You Bring: Experience with NinjaTrader and
Здравствуйте. Я новичок в трейдинге. Ищу робота для торговли золотом и валютными парами. Так как я новичок в этом деле, то хотелось бы найти хорошего робота, который бы сам определял прибыльную сделку (неважно валютная пара это или золото) и сам бы ее совершал, хотя бы с точностью 90%. О цене поговорим позже. Жду ваших предложений
MT5 中运行的 EA 的主要任务 : 1 EA 将同时选择两对货币进行交易,包括 AUDUSD 、 EURUSD 、 GBPUSD 、 NZDUSD 、 USDCAD 、 USDCHF 、 USDJPY 、 AUDJPY 、 EURAUD 、 EURJPY 、 GBPJPY 、 GBPNZD 和 GBPCHF ,默认设置 GBPUSD 、 EURAUD 。 2 蜡烛图 的时间 区间 包括 15M 、 30M 、 1H 、 2H 、 4H 或 1D 。对于两对货币中的 每一对而言, 将同时密切观察两个 时间区间图。 也就是说,两对 货币 同时 打开 四个窗口,每对默认设置 15M 和 4H 。 如果 您 不肯定如何 为同一货币对打开两个窗口,请不要考虑接受这项工作 。 3 将使用自主开发的指标 CMA 结合 CCI 预测走势。 在某些特殊情况下 ,将使用 马丁格尔策略进行操作。因此,如果您已经拥有基于 Martingale
Required to develop expert advisory which will work on any pair including crypto , forex, gold, silver, oil, simple stragy which will work on RSI,GRID, take profit, grid distance, start and stop button, only buy and only sell, filter for time frame Like 5m to 4 hr. stop loss and take profit .Detail will be shared once you except order
I need to fix the alerts of my SMC Order Blocks indicator, which is a custom indicator created for me some time ago. This custom indicator already has several types of alerts built-in, but I need to fix specific ones while keeping the other existing alerts unchanged, as those do not have any errors. The alert is for a specific Order Blocks pattern. This indicator graphically provides a zigzag, and from there, CHoCH
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,)
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
I want grate robot for making profits that know when to start a good trade and close a trade and must be active all time to avoid lost of money

プロジェクト情報

予算
75+ USD
開発者用
67.5 USD