I have a code in tradingview Pinescript and need it converting to mql4

MQL5 Conversão

Trabalho concluído

Tempo de execução 225 dias

Termos de Referência

here is the script its small

//@version=5
strategy("US500 Trading Strategy", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=1000)

// Input parameters
sma14 = ta.sma(close, 14)
sma50 = ta.sma(close, 50)
sma100 = ta.sma(close, 100)

// Function to check if SMA100 is in a distinct trend
isDistinctTrend(len) =>
    uptrend = true
    downtrend = true
    for i = 0 to len - 1
        if sma100[i] <= sma100[i+1]
            uptrend := false
        if sma100[i] >= sma100[i+1]
            downtrend :=//@version=5
 false
    [uptrend, downtrend]

[distinctUptrend, distinctDowntrend] = isDistinctTrend(10)

// Fibonacci levels
high_12h = ta.highest(high, 720)
low_12h = ta.lowest(low, 720)
fib_range = high_12h - low_12h
upper_15_percent = high_12h - fib_range * 0.15
lower_15_percent = low_12h + fib_range * 0.15

// Check if price is within top or bottom 15% of Fibonacci range
inFibZone = close > upper_15_percent or close < lower_15_percent

// New high/low condition
newHigh = ta.highest(high, 60) == high
newLow = ta.lowest(low, 60) == low
retraceAfterHigh = newHigh and high - low < 4
retraceAfterLow = newLow and high - low < 4

// Flat range condition
flatRange = math.abs(sma100 - sma50) < 4 and math.abs(ta.change(sma100)) < 0.1 and math.abs(ta.change(sma50)) < 0.1

// Entry conditions
longCondition = ta.crossover(sma14, sma50) and distinctUptrend and not inFibZone and not retraceAfterHigh and not flatRange
shortCondition = ta.crossunder(sma14, sma50) and distinctDowntrend and not inFibZone and not retraceAfterLow and not flatRange

// Override condition
longOverride = flatRange and close > sma100 and close > sma14
shortOverride = flatRange and close < sma100 and close < sma14

// Calculate position size
position_size = math.round(strategy.equity * 0.01)

// PineConnector Inputs
PC_ID = input.string("7531755372757", title = "ID Pineconnector",  group="PineConnector")
inputsym = input.string("US500", title = "Ticker", group="PineConnector")
PC_RISK = input.float(1, "Risk Contracts/Equity", group="PineConnector")
PC_LIMIT = input.bool(true, "Use Market Order", group="PineConnector")
PC_LIMIT_PIPS = input.float(5, "Lots Limit Order Distance", group="PineConnector")

// Execute trades
if longCondition or longOverride
    strategy.entry("Long", strategy.long, qty=position_size, alert_message = str.tostring(PC_ID)+',buy,'+inputsym+ ',risk='+str.tostring(PC_RISK))

if shortCondition or shortOverride
    strategy.entry("Short", strategy.short, qty=position_size,alert_message = str.tostring(PC_ID)+',sell,'+inputsym+ ',risk='+str.tostring(PC_RISK))

// Stop loss and take profit management
strategy.exit("Long SL/TP", "Long", stop=strategy.position_avg_price * 0.9825, trail_points=100, trail_offset=35, alert_message =str.tostring(PC_ID)+',closelong,'+inputsym)
strategy.exit("Short SL/TP", "Short", stop=strategy.position_avg_price * 1.0175, trail_points=100, trail_offset=35, alert_message = str.tostring(PC_ID)+',closeshort,'+inputsym)

// Plot SMAs
plot(sma14, color=color.blue, title="SMA 14")
plot(sma50, color=color.red, title="SMA 50")
plot(sma100, color=color.green, title="SMA 100")


Respondido

1
Desenvolvedor 1
Classificação
(102)
Projetos
105
60%
Arbitragem
0
Expirado
0
Livre
2
Desenvolvedor 2
Classificação
(20)
Projetos
32
9%
Arbitragem
0
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(75)
Projetos
227
72%
Arbitragem
6
100% / 0%
Expirado
1
0%
Livre
4
Desenvolvedor 4
Classificação
(180)
Projetos
305
24%
Arbitragem
19
37% / 5%
Expirado
23
8%
Trabalhando
Publicou: 3 códigos
5
Desenvolvedor 5
Classificação
(104)
Projetos
133
43%
Arbitragem
0
Expirado
3
2%
Trabalhando
6
Desenvolvedor 6
Classificação
(132)
Projetos
178
39%
Arbitragem
4
25% / 50%
Expirado
14
8%
Livre
7
Desenvolvedor 7
Classificação
(2)
Projetos
3
0%
Arbitragem
4
25% / 75%
Expirado
1
33%
Trabalhando
8
Desenvolvedor 8
Classificação
(10)
Projetos
6
33%
Arbitragem
4
0% / 50%
Expirado
1
17%
Trabalhando
Pedidos semelhantes
I'm looking for an experienced MQL5 developer to convert a fully functional Pine Script trading strategy into MQL5 for use on MetaTrader 5. The strategy is already backtested and includes entry/exit logic, stop loss, and take profit rules. ✅ Requirements: Strong experience with MQL5 and Pine Script Ability to accurately translate trading logic Clean, well-commented code Responsive communication and timely delivery If
I’m looking for a professional and experienced MQL4 developer who can accurately convert an already completed Pine Script (TradingView) code into a fully functional MT4 indicator or EA. The Pine Script is ready, and I need a clean, bug-free, and optimized MQL4 version that works exactly as intended. Please apply only if you are confident in handling Pine Script to MQL4 conversions. Share relevant past work if
hello great developer Hi I'm going from tradingview pinescript (the code is in the documents ) Need it converted to ninja trader 8. It's an Al brooks concept. Wanting it to print arrows above (for bullish) and below (for bearish) the candles that are "shaved" candles. The candle closes all the way at the top or bottom of the candle
Can you convert 2 think or swim indicators into one ninja trader strategy? There are two 1. kst indicators- the lines at the bottom so when the lines cross above (kst crossing above the signal line) we would buy and if it crosses below we would sell. 2. Reversal: green reversal buy and the red one we sell The ninja strategy Buy: green reversal or kst crossing above the signal line whichever comes first Sell: red
Hello, I need some help with my ninja script I have a pine script strategy I’m trying to convert to ninja script strategy. I done it but the profits are not matching and the reason I’m seeing is it’s difficult to set both a SL and Trailing Stop simultaneously and my strategy needs those
Hello, I am looking for a programmer who can convert from pine script to mql5. You will receive 11 different trading view indicators to convert to Mql5. You may find them simple and straightforward or not. However, you will add unified alert system to simplify things on mql5 and to alert whenever there is a buy or sell instance on the main chart for each indicator. Only 1 of the indicators may require some extra
There is an TradingView Indicator (We don't have PineScript), based on which we have created MQ5 indicator that works well with MT5. However, there are few other things which we couldn't able to figure out from the TradingView Indicator. So, we need someone to crack those things and implement with our existing MQ5 indicator. Once we replicate all functionalities from TradingView indicator to MQ5, we have a plan to
HELLO GREATE DEVEOPER I’m currently using two specific indicators on TradingView that I find very beneficial. However, I primarily trade using NinjaTrader and would like to adapt these indicators for that platform. Additionally, I have a few modifications in mind that I believe would enhance their functionality to suit my trading strategy better. the link is in the documents Here is the link to the first one: And
We are seeking a highly skilled MQL5 developer with experience in automated trading, API integration , and system deployment to help execute a production-ready trading system for the Indian stock market. The core requirement is to build a robust MetaTrader 5-based signal and automation system connected to Zerodha's Kite platform , using a proprietary crossover indicator
I’ve recently started using MetaTrader for the Indian market and I'm working with a custom indicator. I would like to generate buy and sell alerts based on crossover signals from this indicator. To do this, I’m looking for a developer who can help me create an API or a solution that can detect these crossovers and send alerts (via webhook, email, or any preferred method). If you have experience in creating such

Informações sobre o projeto

Orçamento
40+ USD
Desenvolvedor
36 USD
Prazo
para 1 dias