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

MQL5 전환

명시

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")


응답함

1
개발자 1
등급
(1)
프로젝트
1
0%
중재
0
기한 초과
0
무료
2
개발자 2
등급
(14)
프로젝트
23
0%
중재
0
기한 초과
0
무료
3
개발자 3
등급
(60)
프로젝트
182
72%
중재
4
100% / 0%
기한 초과
1
1%
무료
4
개발자 4
등급
(157)
프로젝트
268
25%
중재
13
31% / 8%
기한 초과
16
6%
로드됨
5
개발자 5
등급
(71)
프로젝트
94
38%
중재
0
기한 초과
3
3%
작업중
6
개발자 6
등급
(127)
프로젝트
161
35%
중재
4
25% / 50%
기한 초과
13
8%
작업중
7
개발자 7
등급
(2)
프로젝트
2
0%
중재
2
0% / 50%
기한 초과
1
50%
로드됨
8
개발자 8
등급
(5)
프로젝트
5
20%
중재
0
기한 초과
1
20%
작업중
비슷한 주문
I have an Expert Advisor in ex4 and mq4 file formats that I would like to recreate with its original strategy. I believe the file have a bug or one error inside or maybe also is a Decomp file , and as a result, I am unable to understand the rules it follows to evaluate the market and open orders. I am looking for a developer who can help me reconstruct the strategy accurately. The mql4 format file would need to be
Skarito98 30 - 100 USD
Always stay winning and survive....we all want a better life now this is a chance someone can take,to change their lives for the better.No one is supposed to suffer in this world,we create and invert new things and come up with ideas to solve situations we come across especially when it comes to finance. We all need better things in life and God want good things for us
hello i need a professional to convert a fully functioning buy and sell signal strategy on tradingview to EA mt4 , the signals trigger when the bar closed match all conditions , it has a specific calculation for strength of each pair
Attached is a ThinkScript Strategy. I would like to convert it into an Expert Advisor for MQL4. Here is a link of a PineScript code for a similar indicator. This is just to give you additional info about the indicator, hence helping you to convert it from Thinkscript to MQL4
hi. I hv a strategy on tradingview need to convert to MT4/MT5 expert advisor for algo trading. would like to add some tradingview strategy setting to the EA(not included in my tradingview code): recalculate after order is filled, order size: xx% of equity
Only with feedbacks 30 - 100 USD
PINESCRIPT->MQL4 i need a exactly conversion of the file attached to mql4 with source code (i need the source code), obviously as indicator for mt4 let me know your bid and timeline
C onversion from Ninjatrader to Tradingview. This includes thorough testing and debugging to guarantee that the script functions as intended on Tradingview...If you are in for this job kindly bid
I have a scource code for a think or swim indicator that I would like to have coded to pine script so that it can run in trading view. If you have experience in doing this type of work please contact me. Thank you
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility
Hi, i have a tos script i need converted to Ninja script, but someone who knows both coding. Cant be someone who is just going to paste into chat gpt, it requires more understanding for compatibility

프로젝트 정보

예산
40+ USD
개발자에게
36 USD
기한
 1 일