HLC Trend multi tester
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © cmartin81

//@version=5
indicator("HLC Trend tester",timeframe="", timeframe_gaps=true)


startDate = input.time(timestamp("01 Jan 2021 00:00 +0000"), "Start", group="Dates")
endDate = input.time(timestamp("22 Oct 2099 00:00 +0000"), "end", group="Dates")
dateRange() => time >= startDate and time <= endDate ? true : false   // specify where date range is true

//lowType = input.string(title="Low moving average type", defval="EMA", options=["SMA", "EMA", "DEMA", "HMA", "TEMA", "WMA", "VWMA", "SMMA"], group="low")
lowLength = input(5, group="low")

closeType = input.string(title="Close moving average type", defval="EMA", options=["SMA", "EMA", "DEMA", "HMA", "TEMA", "WMA", "VWMA", "SMMA"], group="close")
closeLength = input(4, group="close")

//highType = input.string(title="High moving average type", defval="EMA", options=["SMA", "EMA", "DEMA", "HMA", "TEMA", "WMA", "VWMA", "SMMA"], group="high")
highLength = input(36, group="high")


color_1 = color.aqua // #00BCD4	
color_2 = color.blue // #2196F3	
color_3 = color.teal // #00897B	
color_4 = color.green // #4CAF50	
color_5 = color.olive // #808000	
color_6 = color.lime // #00E676	
color_7 = color.yellow // #FFEB3B
color_8 = color.orange // #FF9800	
color_9 = color.maroon // #880E4F	
color_10 = color.red // #FF5252	
color_11 = color.fuchsia // #E040FB	
color_12 = color.purple // #9C27B0
color_13 = color.navy // #311B92	
color_14 = color.black // #363A45	
color_15 = color.gray // #787B86	
color_16 = color.silver // #B2B5BE	
color_17 = color.white // #FFFFFF	

// Indicator based on article found on TrendXplorer.com
_smma(src, length) => 
    smma = 0.0
    smma := na(smma[1]) ? ta.sma(src, length) : (smma[1] * (length - 1) + src) / length
    smma
    
_dema(src, length) => 
    e1 = ta.ema(src, length)
    e2 = ta.ema(e1, length)
    2 * e1 - e2
    
_tema(src, length) => 
    ema1 = ta.ema(src, length)
    ema2 = ta.ema(ema1, length)
    ema3 = ta.ema(ema2, length)
    3 * (ema1 - ema2) + ema3


_em(type, src, maLength) => 
    switch type
        "SMA" => ta.sma(src, maLength)
        "EMA" => ta.ema(src, maLength)
        "DEMA" => _dema(src, maLength)
        "HMA" => ta.hma(src, maLength)
        "TEMA" => _tema(src, maLength)
        "WMA" => ta.wma(src, maLength)
        "VWMA" => ta.vwma(src, maLength)
        "SMMA" => _smma(src, maLength) 
        =>
            runtime.error(type)
            float(na)    
            

hlcTrend(highType, closeType, lowType) =>
    maLow = _em(lowType, low, lowLength)
    maClose = _em(closeType, close, closeLength)
    maHigh = _em(highType, high, highLength)        

    bullLine = maClose-maHigh
    bearLine = maLow-maClose

    buy = ta.crossover(bullLine, bearLine)
    sell = ta.crossover(bearLine, bullLine)
    
    [buy, sell]


// SMA - SMA
var lastBuyPrice1 = 0.0
var result1 = 100.0

[buy1,sell1] = hlcTrend('SMA', closeType, 'SMA')

if dateRange() and buy1 and lastBuyPrice1 == 0
    lastBuyPrice1 := close
else if dateRange() and sell1 and lastBuyPrice1 != 0
    result1 := close/lastBuyPrice1 * result1
    lastBuyPrice1 := 0.0

plot(result1 - 100, title="SMA-SMA", color=color.new(color_1, 0))

// SMA - EMA
var lastBuyPrice2 = 0.0
var result2 = 100.0

[buy2,sell2] = hlcTrend('SMA', closeType, 'EMA')

if dateRange() and buy2 and lastBuyPrice2 == 0
    lastBuyPrice2 := close
else if dateRange() and sell2 and lastBuyPrice2 != 0
    result2 := close/lastBuyPrice2 * result2
    lastBuyPrice2 := 0.0

plot(result2 - 100, title="SMA-EMA", color=color.new(color_2, 0))

// SMA - DEMA
var lastBuyPrice3 = 0.0
var result3 = 100.0

[buy3,sell3] = hlcTrend('SMA', closeType, 'DEMA')

if dateRange() and buy3 and lastBuyPrice3 == 0
    lastBuyPrice3 := close
else if dateRange() and sell3 and lastBuyPrice3 != 0
    result3 := close/lastBuyPrice3 * result3
    lastBuyPrice3 := 0.0

plot(result3 - 100, title="SMA-DEMA", color=color.new(color_3, 0))


// SMA - HMA
var lastBuyPrice4 = 0.0
var result4 = 100.0

[buy4,sell4] = hlcTrend('SMA', closeType, 'HMA')

if dateRange() and buy4 and lastBuyPrice4 == 0
    lastBuyPrice4 := close
else if dateRange() and sell4 and lastBuyPrice4 != 0
    result4 := close/lastBuyPrice4 * result4
    lastBuyPrice4 := 0.0

plot(result4 - 100, title="SMA-HMA", color=color.new(color_4, 0))

// SMA - TEMA
var lastBuyPrice5 = 0.0
var result5 = 100.0

[buy5,sell5] = hlcTrend('SMA', closeType, 'TEMA')

if dateRange() and buy5 and lastBuyPrice5 == 0
    lastBuyPrice5 := close
else if dateRange() and sell5 and lastBuyPrice5 != 0
    result5 := close/lastBuyPrice5 * result5
    lastBuyPrice5 := 0.0

plot(result5 - 100, title="SMA-TEMA", color=color.new(color_5, 0))

// SMA - WMA
var lastBuyPrice6 = 0.0
var result6 = 100.0

[buy6,sell6] = hlcTrend('SMA', closeType, 'WMA')

if dateRange() and buy6 and lastBuyPrice6 == 0
    lastBuyPrice6 := close
else if dateRange() and sell6 and lastBuyPrice6 != 0
    result6 := close/lastBuyPrice6 * result6
    lastBuyPrice6 := 0.0

plot(result6 - 100, title="SMA-WMA", color=color.new(color_6, 0))

// SMA - VWMA
var lastBuyPrice7 = 0.0
var result7 = 100.0

[buy7,sell7] = hlcTrend('SMA', closeType, 'VWMA')

if dateRange() and buy7 and lastBuyPrice7 == 0
    lastBuyPrice7 := close
else if dateRange() and sell7 and lastBuyPrice7 != 0
    result7 := close/lastBuyPrice7 * result7
    lastBuyPrice7 := 0.0

plot(result7 - 100, title="SMA-VWMA", color=color.new(color_12, 0))


// SMA - SMMA
var lastBuyPrice8 = 0.0
var result8 = 100.0

[buy8,sell8] = hlcTrend('SMA', closeType, 'SMMA')

if dateRange() and buy8 and lastBuyPrice8 == 0
    lastBuyPrice8 := close
else if dateRange() and sell8 and lastBuyPrice8 != 0
    result8 := close/lastBuyPrice8 * result8
    lastBuyPrice8 := 0.0

plot(result8 - 100, title="SMA-SMMA", color=color.new(color_7, 0))

// EMA - SMA
var lastBuyPrice9 = 0.0
var result9 = 100.0

[buy9,sell9] = hlcTrend('EMA', closeType, 'SMA')

if dateRange() and buy9 and lastBuyPrice9 == 0
    lastBuyPrice9 := close
else if dateRange() and sell9 and lastBuyPrice9 != 0
    result9 := close/lastBuyPrice9 * result9
    lastBuyPrice9 := 0.0

plot(result9 - 100, title="EMA-SMA", color=color.new(color_8, 0))

// EMA - EMA
var lastBuyPrice10 = 0.0
var result10 = 100.0

[buy10,sell10] = hlcTrend('EMA', closeType, 'EMA')

if dateRange() and buy10 and lastBuyPrice10 == 0
    lastBuyPrice10 := close
else if dateRange() and sell10 and lastBuyPrice10 != 0
    result10 := close/lastBuyPrice10 * result10
    lastBuyPrice10 := 0.0

plot(result10 - 100, title="EMA-EMA", color=color.new(color_9, 0))

// EMA - DEMA
var lastBuyPrice11 = 0.0
var result11 = 100.0

[buy11,sell11] = hlcTrend('EMA', closeType, 'DEMA')

if dateRange() and buy11 and lastBuyPrice11 == 0
    lastBuyPrice11 := close
else if dateRange() and sell11 and lastBuyPrice11 != 0
    result11 := close/lastBuyPrice11 * result11
    lastBuyPrice11 := 0.0

plot(result11 - 100, title="EMA-DEMA", color=color.new(color_10, 0))


// EMA - HMA
var lastBuyPrice12 = 0.0
var result12 = 100.0

[buy12,sell12] = hlcTrend('EMA', closeType, 'HMA')

if dateRange() and buy12 and lastBuyPrice12 == 0
    lastBuyPrice12 := close
else if dateRange() and sell12 and lastBuyPrice12 != 0
    result12 := close/lastBuyPrice12 * result12
    lastBuyPrice12 := 0.0

plot(result12 - 100, title="EMA-HMA", color=color.new(color_11, 0))

// EMA - TEMA
var lastBuyPrice13 = 0.0
var result13 = 100.0

[buy13,sell13] = hlcTrend('EMA', closeType, 'TEMA')

if dateRange() and buy13 and lastBuyPrice13 == 0
    lastBuyPrice13 := close
else if dateRange() and sell13 and lastBuyPrice13 != 0
    result13 := close/lastBuyPrice13 * result13
    lastBuyPrice13 := 0.0

plot(result13 - 100, title="EMA-TEMA", color=color.new(color_12, 0))

// EMA - WMA
var lastBuyPrice14 = 0.0
var result14 = 100.0

[buy14,sell14] = hlcTrend('EMA', closeType, 'WMA')

if dateRange() and buy14 and lastBuyPrice14 == 0
    lastBuyPrice14 := close
else if dateRange() and sell14 and lastBuyPrice14 != 0
    result14 := close/lastBuyPrice14 * result14
    lastBuyPrice14 := 0.0

plot(result14 - 100, title="EMA-WMA", color=color.new(color_13, 0))

// EMA - VWMA
var lastBuyPrice15 = 0.0
var result15 = 100.0

[buy15,sell15] = hlcTrend('EMA', closeType, 'VWMA')

if dateRange() and buy15 and lastBuyPrice15 == 0
    lastBuyPrice15 := close
else if dateRange() and sell15 and lastBuyPrice15 != 0
    result15 := close/lastBuyPrice15 * result15
    lastBuyPrice15 := 0.0

plot(result15 - 100, title="EMA-VWMA", color=color.new(color_14, 0))


// EMA - SMMA
var lastBuyPrice16 = 0.0
var result16 = 100.0

[buy16,sell16] = hlcTrend('EMA', closeType, 'SMMA')

if dateRange() and buy16 and lastBuyPrice16 == 0
    lastBuyPrice16 := close
else if dateRange() and sell16 and lastBuyPrice16 != 0
    result16 := close/lastBuyPrice16 * result16
    lastBuyPrice16 := 0.0

plot(result16 - 100, title="EMA-SMMA", color=color.new(color_15, 0))

// DEMA - SMA
var lastBuyPrice17 = 0.0
var result17 = 100.0

[buy17,sell17] = hlcTrend('DEMA', closeType, 'SMA')

if dateRange() and buy17 and lastBuyPrice17 == 0
    lastBuyPrice17 := close
else if dateRange() and sell17 and lastBuyPrice17 != 0
    result17 := close/lastBuyPrice17 * result17
    lastBuyPrice17 := 0.0

plot(result17 - 100, title="DEMA-SMA", color=color.new(color_16, 0))

// DEMA - EMA
var lastBuyPrice18 = 0.0
var result18 = 100.0

[buy18,sell18] = hlcTrend('DEMA', closeType, 'EMA')

if dateRange() and buy18 and lastBuyPrice18 == 0
    lastBuyPrice18 := close
else if dateRange() and sell18 and lastBuyPrice18 != 0
    result18 := close/lastBuyPrice18 * result18
    lastBuyPrice18 := 0.0

plot(result18 - 100, title="DEMA-EMA", color=color.new(color_17, 0))

// DEMA - DEMA
var lastBuyPrice19 = 0.0
var result19 = 100.0

[buy19,sell19] = hlcTrend('DEMA', closeType, 'DEMA')

if dateRange() and buy19 and lastBuyPrice19 == 0
    lastBuyPrice19 := close
else if dateRange() and sell19 and lastBuyPrice19 != 0
    result19 := close/lastBuyPrice19 * result19
    lastBuyPrice19 := 0.0

plot(result19 - 100, title="DEMA-DEMA", color=color.new(color_1, 30))


// DEMA - HMA
var lastBuyPrice20 = 0.0
var result20 = 100.0

[buy20,sell20] = hlcTrend('DEMA', closeType, 'HMA')

if dateRange() and buy20 and lastBuyPrice20 == 0
    lastBuyPrice20 := close
else if dateRange() and sell20 and lastBuyPrice20 != 0
    result20 := close/lastBuyPrice20 * result20
    lastBuyPrice20 := 0.0

plot(result20 - 100, title="DEMA-HMA", color=color.new(color_2, 30))

// DEMA - TEMA
var lastBuyPrice21 = 0.0
var result21 = 100.0

[buy21,sell21] = hlcTrend('DEMA', closeType, 'TEMA')

if dateRange() and buy21 and lastBuyPrice21 == 0
    lastBuyPrice21 := close
else if dateRange() and sell21 and lastBuyPrice21 != 0
    result21 := close/lastBuyPrice21 * result21
    lastBuyPrice21 := 0.0

plot(result21 - 100, title="DEMA-TEMA", color=color.new(color_3, 30))

// DEMA - WMA
var lastBuyPrice22 = 0.0
var result22 = 100.0

[buy22,sell22] = hlcTrend('DEMA', closeType, 'WMA')

if dateRange() and buy22 and lastBuyPrice22 == 0
    lastBuyPrice22 := close
else if dateRange() and sell22 and lastBuyPrice22 != 0
    result22 := close/lastBuyPrice22 * result22
    lastBuyPrice22 := 0.0

plot(result22 - 100, title="DEMA-WMA", color=color.new(color_4, 30))

// DEMA - VWMA
var lastBuyPrice23 = 0.0
var result23 = 100.0

[buy23,sell23] = hlcTrend('DEMA', closeType, 'VWMA')

if dateRange() and buy23 and lastBuyPrice23 == 0
    lastBuyPrice23 := close
else if dateRange() and sell23 and lastBuyPrice23 != 0
    result23 := close/lastBuyPrice23 * result23
    lastBuyPrice23 := 0.0

plot(result23 - 100, title="DEMA-VWMA", color=color.new(color_5, 30))


// DEMA - SMMA
var lastBuyPrice24 = 0.0
var result24 = 100.0

[buy24,sell24] = hlcTrend('DEMA', closeType, 'SMMA')

if dateRange() and buy24 and lastBuyPrice24 == 0
    lastBuyPrice24 := close
else if dateRange() and sell24 and lastBuyPrice24 != 0
    result24 := close/lastBuyPrice24 * result24
    lastBuyPrice24 := 0.0

plot(result24 - 100, title="DEMA-SMMA", color=color.new(color_6, 30))

// HMA - SMA
var lastBuyPrice25 = 0.0
var result25 = 100.0

[buy25,sell25] = hlcTrend('HMA', closeType, 'SMA')

if dateRange() and buy25 and lastBuyPrice25 == 0
    lastBuyPrice25 := close
else if dateRange() and sell25 and lastBuyPrice25 != 0
    result25 := close/lastBuyPrice25 * result25
    lastBuyPrice25 := 0.0

plot(result25 - 100, title="HMA-SMA", color=color.new(color_13, 30))

// HMA - EMA
var lastBuyPrice26 = 0.0
var result26 = 100.0

[buy26,sell26] = hlcTrend('HMA', closeType, 'EMA')

if dateRange() and buy26 and lastBuyPrice26 == 0
    lastBuyPrice26 := close
else if dateRange() and sell26 and lastBuyPrice26 != 0
    result26 := close/lastBuyPrice26 * result26
    lastBuyPrice26 := 0.0

plot(result26 - 100, title="HMA-EMA", color=color.new(color_7, 30))

// HMA - DEMA
var lastBuyPrice27 = 0.0
var result27 = 100.0

[buy27,sell27] = hlcTrend('HMA', closeType, 'DEMA')

if dateRange() and buy27 and lastBuyPrice27 == 0
    lastBuyPrice27 := close
else if dateRange() and sell27 and lastBuyPrice27 != 0
    result27 := close/lastBuyPrice27 * result27
    lastBuyPrice27 := 0.0

plot(result27 - 100, title="HMA-DEMA", color=color.new(color_8, 30))


// HMA - HMA
var lastBuyPrice28 = 0.0
var result28 = 100.0

[buy28,sell28] = hlcTrend('HMA', closeType, 'HMA')

if dateRange() and buy28 and lastBuyPrice28 == 0
    lastBuyPrice28 := close
else if dateRange() and sell28 and lastBuyPrice28 != 0
    result28 := close/lastBuyPrice28 * result28
    lastBuyPrice28 := 0.0

plot(result28 - 100, title="HMA-HMA", color=color.new(color_9, 30))

// HMA - TEMA
var lastBuyPrice29 = 0.0
var result29 = 100.0

[buy29,sell29] = hlcTrend('HMA', closeType, 'TEMA')

if dateRange() and buy29 and lastBuyPrice29 == 0
    lastBuyPrice29 := close
else if dateRange() and sell29 and lastBuyPrice29 != 0
    result29 := close/lastBuyPrice29 * result29
    lastBuyPrice29 := 0.0

plot(result29 - 100, title="HMA-TEMA", color=color.new(color_10, 30))

// HMA - WMA
var lastBuyPrice30 = 0.0
var result30 = 100.0

[buy30,sell30] = hlcTrend('HMA', closeType, 'WMA')

if dateRange() and buy30 and lastBuyPrice30 == 0
    lastBuyPrice30 := close
else if dateRange() and sell30 and lastBuyPrice30 != 0
    result30 := close/lastBuyPrice30 * result30
    lastBuyPrice30 := 0.0

plot(result30 - 100, title="HMA-WMA", color=color.new(color_11, 30))

// HMA - VWMA
var lastBuyPrice31 = 0.0
var result31 = 100.0

[buy31,sell31] = hlcTrend('HMA', closeType, 'VWMA')

if dateRange() and buy31 and lastBuyPrice31 == 0
    lastBuyPrice31 := close
else if dateRange() and sell31 and lastBuyPrice31 != 0
    result31 := close/lastBuyPrice31 * result31
    lastBuyPrice31 := 0.0

plot(result31 - 100, title="HMA-VWMA", color=color.new(color_12, 30))


// HMA - SMMA
var lastBuyPrice32 = 0.0
var result32 = 100.0

[buy32,sell32] = hlcTrend('HMA', closeType, 'SMMA')

if dateRange() and buy32 and lastBuyPrice32 == 0
    lastBuyPrice32 := close
else if dateRange() and sell32 and lastBuyPrice32 != 0
    result32 := close/lastBuyPrice32 * result32
    lastBuyPrice32 := 0.0

plot(result32 - 100, title="HMA-SMMA", color=color.new(color_13, 30))

// TEMA - SMA
var lastBuyPrice33 = 0.0
var result33 = 100.0

[buy33,sell33] = hlcTrend('TEMA', closeType, 'SMA')

if dateRange() and buy33 and lastBuyPrice33 == 0
    lastBuyPrice33 := close
else if dateRange() and sell33 and lastBuyPrice33 != 0
    result33 := close/lastBuyPrice33 * result33
    lastBuyPrice33 := 0.0

plot(result33 - 100, title="TEMA-SMA", color=color.new(color_14, 30))

// TEMA - EMA
var lastBuyPrice34 = 0.0
var result34 = 100.0

[buy34,sell34] = hlcTrend('TEMA', closeType, 'EMA')

if dateRange() and buy34 and lastBuyPrice34 == 0
    lastBuyPrice34 := close
else if dateRange() and sell34 and lastBuyPrice34 != 0
    result34 := close/lastBuyPrice34 * result34
    lastBuyPrice34 := 0.0

plot(result34 - 100, title="TEMA-EMA", color=color.new(color_15, 30))

// TEMA - DEMA
var lastBuyPrice35 = 0.0
var result35 = 100.0

[buy35,sell35] = hlcTrend('TEMA', closeType, 'DEMA')

if dateRange() and buy35 and lastBuyPrice35 == 0
    lastBuyPrice35 := close
else if dateRange() and sell35 and lastBuyPrice35 != 0
    result35 := close/lastBuyPrice35 * result35
    lastBuyPrice35 := 0.0

plot(result35 - 100, title="TEMA-DEMA", color=color.new(color_16, 30))


// TEMA - HMA
var lastBuyPrice36 = 0.0
var result36 = 100.0

[buy36,sell36] = hlcTrend('TEMA', closeType, 'HMA')

if dateRange() and buy36 and lastBuyPrice36 == 0
    lastBuyPrice36 := close
else if dateRange() and sell36 and lastBuyPrice36 != 0
    result36 := close/lastBuyPrice36 * result36
    lastBuyPrice36 := 0.0

plot(result36 - 100, title="TEMA-HMA", color=color.new(color_17, 30))

// TEMA - TEMA
var lastBuyPrice37 = 0.0
var result37 = 100.0

[buy37,sell37] = hlcTrend('TEMA', closeType, 'TEMA')

if dateRange() and buy37 and lastBuyPrice37 == 0
    lastBuyPrice37 := close
else if dateRange() and sell37 and lastBuyPrice37 != 0
    result37 := close/lastBuyPrice37 * result37
    lastBuyPrice37 := 0.0

plot(result37 - 100, title="TEMA-TEMA", color=color.new(color_1, 60))

// TEMA - WMA
var lastBuyPrice38 = 0.0
var result38 = 100.0

[buy38,sell38] = hlcTrend('TEMA', closeType, 'WMA')

if dateRange() and buy38 and lastBuyPrice38 == 0
    lastBuyPrice38 := close
else if dateRange() and sell38 and lastBuyPrice38 != 0
    result38 := close/lastBuyPrice38 * result38
    lastBuyPrice38 := 0.0

plot(result38 - 100, title="TEMA-WMA", color=color.new(color_2, 60))

// TEMA - VWMA
var lastBuyPrice39 = 0.0
var result39 = 100.0

[buy39,sell39] = hlcTrend('TEMA', closeType, 'VWMA')

if dateRange() and buy39 and lastBuyPrice39 == 0
    lastBuyPrice39 := close
else if dateRange() and sell39 and lastBuyPrice39 != 0
    result39 := close/lastBuyPrice39 * result39
    lastBuyPrice39 := 0.0

plot(result39 - 100, title="TEMA-VWMA", color=color.new(color_3, 60))


// TEMA - SMMA
var lastBuyPrice40 = 0.0
var result40 = 100.0

[buy40,sell40] = hlcTrend('TEMA', closeType, 'SMMA')

if dateRange() and buy40 and lastBuyPrice40 == 0
    lastBuyPrice40 := close
else if dateRange() and sell40 and lastBuyPrice40 != 0
    result40 := close/lastBuyPrice40 * result40
    lastBuyPrice40 := 0.0

plot(result40 - 100, title="TEMA-SMMA", color=color.new(color_4, 60))

// WMA - SMA
var lastBuyPrice41 = 0.0
var result41 = 100.0

[buy41,sell41] = hlcTrend('WMA', closeType, 'SMA')

if dateRange() and buy41 and lastBuyPrice41 == 0
    lastBuyPrice41 := close
else if dateRange() and sell41 and lastBuyPrice41 != 0
    result41 := close/lastBuyPrice41 * result41
    lastBuyPrice41 := 0.0

plot(result41 - 100, title="WMA-SMA", color=color.new(color_5, 60))

// WMA - EMA
var lastBuyPrice42 = 0.0
var result42 = 100.0

[buy42,sell42] = hlcTrend('WMA', closeType, 'EMA')

if dateRange() and buy42 and lastBuyPrice42 == 0
    lastBuyPrice42 := close
else if dateRange() and sell42 and lastBuyPrice42 != 0
    result42 := close/lastBuyPrice42 * result42
    lastBuyPrice42 := 0.0

plot(result42 - 100, title="WMA-EMA", color=color.new(color_6, 60))

// WMA - DEMA
var lastBuyPrice43 = 0.0
var result43 = 100.0

[buy43,sell43] = hlcTrend('WMA', closeType, 'DEMA')

if dateRange() and buy43 and lastBuyPrice43 == 0
    lastBuyPrice43 := close
else if dateRange() and sell43 and lastBuyPrice43 != 0
    result43 := close/lastBuyPrice43 * result43
    lastBuyPrice43 := 0.0

plot(result43 - 100, title="WMA-DEMA", color=color.new(color_7, 60))


// WMA - HMA
var lastBuyPrice44 = 0.0
var result44 = 100.0

[buy44,sell44] = hlcTrend('WMA', closeType, 'HMA')

if dateRange() and buy44 and lastBuyPrice44 == 0
    lastBuyPrice44 := close
else if dateRange() and sell44 and lastBuyPrice44 != 0
    result44 := close/lastBuyPrice44 * result44
    lastBuyPrice44 := 0.0

plot(result44 - 100, title="WMA-HMA", color=color.new(color_8, 60))

// WMA - TEMA
var lastBuyPrice45 = 0.0
var result45 = 100.0

[buy45,sell45] = hlcTrend('WMA', closeType, 'TEMA')

if dateRange() and buy45 and lastBuyPrice45 == 0
    lastBuyPrice45 := close
else if dateRange() and sell45 and lastBuyPrice45 != 0
    result45 := close/lastBuyPrice45 * result45
    lastBuyPrice45 := 0.0

plot(result45 - 100, title="WMA-TEMA", color=color.new(color_9, 60))

// WMA - WMA
var lastBuyPrice46 = 0.0
var result46 = 100.0

[buy46,sell46] = hlcTrend('WMA', closeType, 'WMA')

if dateRange() and buy46 and lastBuyPrice46 == 0
    lastBuyPrice46 := close
else if dateRange() and sell46 and lastBuyPrice46 != 0
    result46 := close/lastBuyPrice46 * result46
    lastBuyPrice46 := 0.0

plot(result46 - 100, title="WMA-WMA", color=color.new(color_10, 60))

// WMA - VWMA
var lastBuyPrice47 = 0.0
var result47 = 100.0

[buy47,sell47] = hlcTrend('WMA', closeType, 'VWMA')

if dateRange() and buy47 and lastBuyPrice47 == 0
    lastBuyPrice47 := close
else if dateRange() and sell47 and lastBuyPrice47 != 0
    result47 := close/lastBuyPrice47 * result47
    lastBuyPrice47 := 0.0

plot(result47 - 100, title="WMA-VWMA", color=color.new(color_11, 60))


// WMA - SMMA
var lastBuyPrice48 = 0.0
var result48 = 100.0

[buy48,sell48] = hlcTrend('WMA', closeType, 'SMMA')

if dateRange() and buy48 and lastBuyPrice48 == 0
    lastBuyPrice48 := close
else if dateRange() and sell48 and lastBuyPrice48 != 0
    result48 := close/lastBuyPrice48 * result48
    lastBuyPrice48 := 0.0

plot(result48 - 100, title="WMA-SMMA", color=color.new(color_12, 60))

// VWMA - SMA
var lastBuyPrice49 = 0.0
var result49 = 100.0

[buy49,sell49] = hlcTrend('VWMA', closeType, 'SMA')

if dateRange() and buy49 and lastBuyPrice49 == 0
    lastBuyPrice49 := close
else if dateRange() and sell49 and lastBuyPrice49 != 0
    result49 := close/lastBuyPrice49 * result49
    lastBuyPrice49 := 0.0

plot(result49 - 100, title="VWMA-SMA", color=color.new(color_13, 60))

// VWMA - EMA
var lastBuyPrice50 = 0.0
var result50 = 100.0

[buy50,sell50] = hlcTrend('VWMA', closeType, 'EMA')

if dateRange() and buy50 and lastBuyPrice50 == 0
    lastBuyPrice50 := close
else if dateRange() and sell50 and lastBuyPrice50 != 0
    result50 := close/lastBuyPrice50 * result50
    lastBuyPrice50 := 0.0

plot(result50 - 100, title="VWMA-EMA", color=color.new(color_14, 60))

// VWMA - DEMA
var lastBuyPrice51 = 0.0
var result51 = 100.0

[buy51,sell51] = hlcTrend('VWMA', closeType, 'DEMA')

if dateRange() and buy51 and lastBuyPrice51 == 0
    lastBuyPrice51 := close
else if dateRange() and sell51 and lastBuyPrice51 != 0
    result51 := close/lastBuyPrice51 * result51
    lastBuyPrice51 := 0.0

plot(result51 - 100, title="VWMA-DEMA", color=color.new(color_15, 60))


// VWMA - HMA
var lastBuyPrice52 = 0.0
var result52 = 100.0

[buy52,sell52] = hlcTrend('VWMA', closeType, 'HMA')

if dateRange() and buy52 and lastBuyPrice52 == 0
    lastBuyPrice52 := close
else if dateRange() and sell52 and lastBuyPrice52 != 0
    result52 := close/lastBuyPrice52 * result52
    lastBuyPrice52 := 0.0

plot(result52 - 100, title="VWMA-HMA", color=color.new(color_16, 60))

// VWMA - TEMA
var lastBuyPrice53 = 0.0
var result53 = 100.0

[buy53,sell53] = hlcTrend('VWMA', closeType, 'TEMA')

if dateRange() and buy53 and lastBuyPrice53 == 0
    lastBuyPrice53 := close
else if dateRange() and sell53 and lastBuyPrice53 != 0
    result53 := close/lastBuyPrice53 * result53
    lastBuyPrice53 := 0.0

plot(result53 - 100, title="VWMA-TEMA", color=color.new(color_17, 60))

// VWMA - WMA
var lastBuyPrice54 = 0.0
var result54 = 100.0

[buy54,sell54] = hlcTrend('VWMA', closeType, 'WMA')

if dateRange() and buy54 and lastBuyPrice54 == 0
    lastBuyPrice54 := close
else if dateRange() and sell54 and lastBuyPrice54 != 0
    result54 := close/lastBuyPrice54 * result54
    lastBuyPrice54 := 0.0

plot(result54 - 100, title="VWMA-WMA", color=color.new(color_1, 80))

// VWMA - VWMA
var lastBuyPrice55 = 0.0
var result55 = 100.0

[buy55,sell55] = hlcTrend('VWMA', closeType, 'VWMA')

if dateRange() and buy55 and lastBuyPrice55 == 0
    lastBuyPrice55 := close
else if dateRange() and sell55 and lastBuyPrice55 != 0
    result55 := close/lastBuyPrice55 * result55
    lastBuyPrice55 := 0.0

plot(result55 - 100, title="VWMA-VWMA", color=color.new(color_2, 80))


// VWMA - SMMA
var lastBuyPrice56 = 0.0
var result56 = 100.0

[buy56,sell56] = hlcTrend('VWMA', closeType, 'SMMA')

if dateRange() and buy56 and lastBuyPrice56 == 0
    lastBuyPrice56 := close
else if dateRange() and sell56 and lastBuyPrice56 != 0
    result56 := close/lastBuyPrice56 * result56
    lastBuyPrice56 := 0.0

plot(result56 - 100, title="VWMA-SMMA", color=color.new(color_3, 80))

// SMMA - SMA
var lastBuyPrice57 = 0.0
var result57 = 100.0

[buy57,sell57] = hlcTrend('SMMA', closeType, 'SMA')

if dateRange() and buy57 and lastBuyPrice57 == 0
    lastBuyPrice57 := close
else if dateRange() and sell57 and lastBuyPrice57 != 0
    result57 := close/lastBuyPrice57 * result57
    lastBuyPrice57 := 0.0

plot(result57 - 100, title="SMMA-SMA", color=color.new(color_4, 80))

// SMMA - EMA
var lastBuyPrice58 = 0.0
var result58 = 100.0

[buy58,sell58] = hlcTrend('SMMA', closeType, 'EMA')

if dateRange() and buy58 and lastBuyPrice58 == 0
    lastBuyPrice58 := close
else if dateRange() and sell58 and lastBuyPrice58 != 0
    result58 := close/lastBuyPrice58 * result58
    lastBuyPrice58 := 0.0

plot(result58 - 100, title="SMMA-EMA", color=color.new(color_5, 80))

// SMMA - DEMA
var lastBuyPrice59 = 0.0
var result59 = 100.0

[buy59,sell59] = hlcTrend('SMMA', closeType, 'DEMA')

if dateRange() and buy59 and lastBuyPrice59 == 0
    lastBuyPrice59 := close
else if dateRange() and sell59 and lastBuyPrice59 != 0
    result59 := close/lastBuyPrice59 * result59
    lastBuyPrice59 := 0.0

plot(result59 - 100, title="SMMA-DEMA", color=color.new(color_6, 80))


// SMMA - HMA
var lastBuyPrice60 = 0.0
var result60 = 100.0

[buy60,sell60] = hlcTrend('SMMA', closeType, 'HMA')

if dateRange() and buy60 and lastBuyPrice60 == 0
    lastBuyPrice60 := close
else if dateRange() and sell60 and lastBuyPrice60 != 0
    result60 := close/lastBuyPrice60 * result60
    lastBuyPrice60 := 0.0

plot(result60 - 100, title="SMMA-HMA", color=color.new(color_7, 80))

// SMMA - TEMA
var lastBuyPrice61 = 0.0
var result61 = 100.0

[buy61,sell61] = hlcTrend('SMMA', closeType, 'TEMA')

if dateRange() and buy61 and lastBuyPrice61 == 0
    lastBuyPrice61 := close
else if dateRange() and sell61 and lastBuyPrice61 != 0
    result61 := close/lastBuyPrice61 * result61
    lastBuyPrice61 := 0.0

plot(result61 - 100, title="SMMA-TEMA", color=color.new(color_8, 80))

// SMMA - WMA
var lastBuyPrice62 = 0.0
var result62 = 100.0

[buy62,sell62] = hlcTrend('SMMA', closeType, 'WMA')

if dateRange() and buy62 and lastBuyPrice62 == 0
    lastBuyPrice62 := close
else if dateRange() and sell62 and lastBuyPrice62 != 0
    result62 := close/lastBuyPrice62 * result62
    lastBuyPrice62 := 0.0

plot(result62 - 100, title="SMMA-WMA", color=color.new(color_9, 80))

// SMMA - VWMA
var lastBuyPrice63 = 0.0
var result63 = 100.0

[buy63,sell63] = hlcTrend('SMMA', closeType, 'VWMA')

if dateRange() and buy63 and lastBuyPrice63 == 0
    lastBuyPrice63 := close
else if dateRange() and sell63 and lastBuyPrice63 != 0
    result63 := close/lastBuyPrice63 * result63
    lastBuyPrice63 := 0.0

plot(result63 - 100, title="SMMA-VWMA", color=color.new(color_10, 80))


// SMMA - SMMA
var lastBuyPrice64 = 0.0
var result64 = 100.0

[buy64,sell64] = hlcTrend('SMMA', closeType, 'SMMA')

if dateRange() and buy64 and lastBuyPrice64 == 0
    lastBuyPrice64 := close
else if dateRange() and sell64 and lastBuyPrice64 != 0
    result64 := close/lastBuyPrice64 * result64
    lastBuyPrice64 := 0.0

plot(result64 - 100, title="SMMA-SMMA", color=color.new(color_11, 80))