ईएमए क्लाउड इंट्राडे रणनीति

लेखक:चाओझांग, दिनांक: 2022-05-17 16:30:12
टैगःईएमए

यह रणनीति 9 और 20 अवधि के घातीय चलती औसत का उपयोग इचिमोकू क्लाउड पर देखे जाने के समान के बीच एक रंगीन बादल बनाने के लिए करती है। यह रणनीति ट्रेडिंग दिन के अंत तक सभी ट्रेडों को बंद कर देती है। प्रवेश तब होता है जब कीमत ग्रीन (9 ईएमए 20 ईएमए से ऊपर) बादल से ऊपर या रेड (9 ईएमए 20 ईएमए से नीचे) बादल से नीचे बंद हो जाती है। बाहर निकलना तब होता है जब कीमत 9 ईएमए या ट्रेडिंग दिन के अंत में बंद हो जाती है। विभिन्न इंट्राडे टाइम फ्रेम पर रणनीति परीक्षक को चलाने से किसी दिए गए प्रतीक के लिए सबसे अच्छा टाइम फ्रेम दिखाई देगा। उदाहरण के लिए, मैंने पाया है कि SPY के लिए इस रणनीति द्वारा 30 मिनट के समय फ्रेम पर सबसे अच्छे परिणाम लौटाए जाते हैं।

बैकटेस्ट

img


/*backtest
start: 2022-04-16 00:00:00
end: 2022-05-15 23:59:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © rwestbrookjr

//@version=5
strategy("EMA Cloud Intraday Strategy", overlay=true, margin_long=100, margin_short=100, process_orders_on_close=true)

i_trdQty = input.int(10, "Trade Quantity", minval = 1)




fastLen = input(title = "Fast EMA Length", defval = 7)
slowLen = input(title = "Slow EMA Length", defval = 20)

fastEMA = ta.ema(close, fastLen)
slowEMA = ta.ema(close, slowLen)

fema = plot(fastEMA, title = "FastEMA", color = color.green, linewidth = 1, style = plot.style_line)
sema = plot(slowEMA, title = "SlowEMA", color = color.red, linewidth = 1, style = plot.style_line)

fill(fema, sema, color = fastEMA > slowEMA ? color.new(#417505, 50) : color.new(#890101, 50), title = "Cloud")

longCondition = (close > fastEMA and fastEMA > slowEMA)

if (longCondition)
    strategy.entry("Long_Entry", strategy.long)
longExit = close[1] < fastEMA
if (longExit)
    strategy.close("Long_Entry",when=longExit)
    //strategy.exit("exit", "My Long Entry Id", trail_points=1.5, trail_offset=0)

shortCondition = (close < fastEMA and fastEMA < slowEMA)
if (shortCondition)
    strategy.entry("Short_Entry", strategy.short)
shortExit = close[1] > fastEMA
if (shortExit)
    strategy.close("Short_Entry",when=shortExit)
    //strategy.exit("exit", "My Short Entry Id", trail_points=1.5, trail_offset=0)



संबंधित

अधिक