Convert PineScript Strategy to Metatrader 4 Expert Advisor

指定

Hello,


I need to convert the Super Trend 2 Strategy from Tradingview Pine Script to Meta Trader 4 EA, so that it can open and close orders on its own.


Supertrend is a strategy by breizh29 using *rajandran.r* Supertrend Indicator, and here is the original code:



strategy("Super Trend 2", overlay=true, default_qty_value=100)

res = input(title="Main SuperTrend Time Frame", type=resolution, defval="120")

Factor=input(1, minval=1,maxval = 100)

Pd=input(1, minval=1,maxval = 100)


tp = input(500,title="Take Profit")

sl = input(400,title="Stop Loss")



Up=hl2-(Factor*atr(Pd))

Dn=hl2+(Factor*atr(Pd))

MUp=security(tickerid,res,hl2-(Factor*atr(Pd)))

MDn=security(tickerid,res,hl2+(Factor*atr(Pd)))


Mclose=security(tickerid,res,close)


TrendUp=close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up

TrendDown=close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn


MTrendUp=Mclose[1]>MTrendUp[1]? max(MUp,MTrendUp[1]) : MUp

MTrendDown=Mclose[1]<MTrendDown[1]? min(MDn,MTrendDown[1]) : MDn


Trend = close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],1)

Tsl = Trend==1? TrendUp: TrendDown


MTrend = Mclose > MTrendDown[1] ? 1: Mclose< MTrendUp[1]? -1: nz(MTrend[1],1)

MTsl = MTrend==1? MTrendUp: MTrendDown


linecolor = Trend == 1 ? green : red

plot(Tsl, color = linecolor , style = line , linewidth = 2,title = "SuperTrend")


Mlinecolor = MTrend == 1 ? blue : orange

plot(MTsl, color = Mlinecolor , style = line , linewidth = 2,title = "Main SuperTrend")


plotshape(cross(close,Tsl) and close>Tsl , "Up Arrow", shape.triangleup,location.belowbar,green,0,0)

plotshape(cross(Tsl,close) and close<Tsl , "Down Arrow", shape.triangledown , location.abovebar, red,0,0)


up = Trend == 1 and Trend[1] == -1 and MTrend == 1 

down = Trend == -1 and Trend[1] == 1 and MTrend == -1 

plotarrow(up ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=60, minheight=50, transp=0)

plotarrow(down ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=60, minheight=50, transp=0)



golong = Trend == 1 and Trend[1] == -1 and MTrend == 1 

goshort = Trend == -1 and Trend[1] == 1 and MTrend == -1 


strategy.entry("Buy", strategy.long,when=golong)

strategy.exit("Close Buy","Buy",profit=tp,loss=sl)

   

   

strategy.entry("Sell", strategy.short,when=goshort)

strategy.exit("Close Sell","Sell",profit=tp,loss=sl)


応答済み

1
開発者 1
評価
プロジェクト
6
17%
仲裁
2
0% / 50%
期限切れ
0
2
開発者 2
評価
プロジェクト
1295
67%
仲裁
84
26% / 49%
期限切れ
338
26%
3
開発者 3
評価
プロジェクト
369
66%
仲裁
10
50% / 0%
期限切れ
46
12%
4
開発者 4
評価
プロジェクト
933
47%
仲裁
302
59% / 25%
期限切れ
125
13%
取り込み中
類似した注文
Check if you understand my explanation crypto bot or make it mt5 bot Once it opens buy and move positively to buy let it use auto trailing to follow the trend and if it opens buy and move negatively let it martingale I will choose the amount it will open with example I can set it to open with $1 In martingale I can set it on fix that’s any martingale position will still be $1 if I choose fix then it will martingale
Martingale Strategy EA 50 - 300 USD
Dear , I hope this message finds you well. I would like to request the development of a trading robot (Expert Advisor) that incorporates the following strategies and features: Strategy Requirements: 1. Martingale Strategy: The robot should include a Martingale system to increase trade sizes after losses in order to recover losses and generate profit. 2. Trend-Following: It should also be able to detect and follow
Hi, Scalping ea is required in mql5 for JPY currency pairs(usdjpy, audjpy,gbpjpy,cadjpy) and USD currency pairs (audUSD,EURUSD, gbpUSD, NZDUSD, USDcad, USDCHF, xauusd). Scalping ea should be profitable. Please help on this
I'm seeking a Forex HFT Scalping EA that operates on live streaming tick data and candlestick patterns, executing a high frequency of trades without balance restrictions. The EA should be compatible with major currency pairs like EUR/USD, GBP/USD, USD/JPY, AUD/USD, GBP/JPY, GBP/AUD, and XAU/USD, as well as US30 indices. Given its HFT nature, it should focus on the 1-minute, 5-minute, 15-minute, and 30-minute
I have a grid trading bot that needs debugging. its perfect apart from a random stop loss I encountered. It’s supposed to have a stop loss at 99% but it one time closed trades at around 25% loss. Here is a list of potential things causing it to bug out (it’s running on MQL VPS MT5, I also want to retain the ability to close positions manually); - Chart change (symbol or timeframe) - Recompiling the EA - Server
Hi developer, I need a EA bot with forex news filtering for JPY currency pairs(usdjpy, audjpy,gbpjpy,cadjpy) and USD currency pairs (audUSD,EURUSD, gbpUSD, NZDUSD, USDcad, USDCHF, xauusd). That's no problem if you can share your own profitable ea to me for 100 usd. I don't have any idea about ea strategy. But, I need profit in this ea Please share backtest, strategy, how ea works and ea's features
Hello mate .. i am Looking for a skilled developer to integrate my broker into MetaTrader 5 (MT5). Currently, my broker is not available on the platform, and I need someone with expertise in creating or adapting broker connections for MT5. The ideal candidate will have a strong understanding of MT5 architecture. If you are proficient at working with APls and have a background in trading platform integration, please
Hi developer, I need a EA bot with forex news filtering for USD currency pairs (usdjpy, audUSD,EURUSD, gbpUSD, NZDUSD, USDcad, USDCHF, xauusd). That's no problem if you can share your own profitable ea to me. I don't have any idea about ea strategy. But, I need profit in m30 or other TF. Please share backtest, strategy, how ea works and ea's features
Hi Developer, I would like to create the indicator based for Mt4 on the investing.com data https://www.investing.com/currencies/eur-usd-technical. Indicator must show and read all the timeframe in order to get the real time result. Indicator also have selection to select each time frame. Indicator must work at 5 major currencies and gold as well. it will show at MT4 as below Buy = green Sell = red neutral = grey
I need a programmer for converting a MetaTrader indicator into ea for TradeLocker. Additionally, I would like to have a new EA built in TradeLocker that mirrors the logic of the original MetaTrader, including the specific rules and conditions I need. Please contact me only if you have prior experience converting scripts from MetaTrader to TradeLocker

プロジェクト情報

予算
30 - 50 USD
開発者用
27 - 45 USD
締め切り
最高 7 日