DPO BOT STRATEGY PLEASE HELP

 

Hello i'm want help to convert pinescript to mql4 please 


//@version=5


EMA_1=input.int(defval=50, title="EMA1", minval=0, maxval=2000)

EMA_2=input.int(defval=50, title="EMA2", minval=0, maxval=2000)




//indicateur


strategy("Mon script",overlay=true)

EMA1 = ta.ema(close, EMA_1)

EMA2 = ta.ema(close, EMA_2)


plot(EMA1,"EMA1")

plot(EMA2,"EMA2")



//signaux


Buysignal = ta.crossover(EMA1,EMA2)

Closesignal = ta.crossunder(EMA1,EMA2) 


plotchar(Closesignal,char="c")


plotchar(Buysignal,char="b")


//Strategy


strategy.entry("buy",strategy.long,1, when = Buysignal) 


//TakeProfit

TradePris = strategy.position_size[0]> strategy.position_size[1]


Entryvalue = ta.valuewhen(TradePris, open, 0)


Tp = input.int(defval=50, title="TakeProfit", minval=0, maxval=2000)


T10 = Entryvalue * Tp

T11 = T10 / 100

T12 = Entryvalue + T11

plot(T12)


//StopLoss


Sl = input.int(defval=50, title="stoploss", minval=0, maxval=2000)


T5 = Entryvalue / 100*Sl

T6 = Entryvalue - T5

plot(T6)


strategy.entry("short",strategy.short, 1, when = Closesignal or close > T12 or close < T6 )


plot(close)

Thank's for your help!!

 

Vous pouvez le commander auprès de Freelance

https://www.mql5.com/fr/job

Applications de trading pour MetaTrader 5 à commander
Applications de trading pour MetaTrader 5 à commander
  • 2022.07.18
  • www.mql5.com
Le plus grand service de freelance avec des développeurs d'applications MQL5