OPEN-SOURCE SCRIPT

My Strategy

127
//version=5
strategy("My Strategy", overlay = true)

// Create Indicator's
ema1 = ta.ema(close, 8)
ema2 = ta.ema(close, 18)
ema3 = ta.ema(close, 44)

//plot the Indicators

plot(ema1, title = "EMA1", color = color.blue, linewidth = 2)
plot(ema2, title = "EMA2", color = color.red, linewidth = 2)
plot(ema3, title = "EMA3", color = color.black, linewidth = 2)

// Specify crossover conditions

Enterlong = ta.crossover(ema2, ema3)
Exitlong = ta.crossunder(ema1,ema2)

Entershort = ta.crossunder(ema2, ema3)
Exitshort = ta.crossover(ema1,ema2)

//Execution Logic - Placing Orders

strategy.entry("Long", strategy.long, 1, when = Enterlong)
strategy.close("Long", when = Exitlong)

strategy.entry("Short", strategy.short, 1, when = Entershort)
strategy.close("Short", when = Exitshort)



כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.