স্মারকলিপি - PINE কোড

5 min

language: ja bn en es hi pt ru zh-cn zh-tw

https://www.tradingview.com/script/wf7E7MWQ-Bitcoin-CME-Futures-Friday-Close/

এই যে এখানে।

আমি CME গ্যাপ ভিজ্যুয়ালাইজেশন কোডের একটি ETH সংস্করণ তৈরি করেছি।

টেরাপ্যাডে কেবল BTC কে ETH দিয়ে প্রতিস্থাপন করুন।

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

//@version=5
indicator('Ethereum - CME Futures Friday Close', overlay=true)
mode = input.string(
     defval="1 - Close from current symbol",
     title="Mode",
     options=["1 - Close from current symbol", "2 - CME original close crice", "3 - CME settlement price"],
     tooltip="In Mode 1 the closing price is determined in the current symbol but with the tradinghours from the CME futures contract. Mode 2 and 3 obtain the price directly from the CME futures contract and paint it in the chart of the current symbol. But note, that modes 2 and 3  may not give you the expected result, due to price differences in futures and spot prices.")

cme = request.security("CME:ETH1!", "60", close)
cmeSettlement = request.security("CME:ETH1!", "D", close, lookahead=barmerge.lookahead_on)

//Function to get friday closing price according to CME trading hours
getCloseCME() =>
    cmeClose = 0.0
    cmeClosePrev = nz(cmeClose[1], cmeClose)
    showLine = 0
    showLine := nz(showLine[1], showLine)
    
    if mode == "1 - Close from current symbol"
        cmeClose := dayofweek == 6 and time == timestamp('GMT-5', year, month, dayofmonth, 16, 0, 0) ? close[1] : cmeClosePrev
    else if mode == "2 - CME original close crice"
        cmeClose := dayofweek == 6 and time == timestamp('GMT-5', year, month, dayofmonth, 16, 0, 0) ? cme : cmeClosePrev
    else if mode == "3 - CME settlement price"
        cmeClose := dayofweek == 6 and time == timestamp('GMT-5', year, month, dayofmonth, 16, 0, 0) ? cmeSettlement : cmeClosePrev
    showLine := showLine == 0 and time >= timestamp('GMT-5', year, month, dayofmonth, 16, 0, 0) and dayofweek >= 6 ? 1 : showLine == 1 and dayofweek <= 1 and time >= timestamp('GMT-5', year, month, dayofmonth, 17, 0, 0) ? 0 : showLine

    [cmeClose, showLine]

[cmeClose, showLine] = getCloseCME()

//Plotting
plot1 = plot(showLine == 1 ? cmeClose : na, 'CME Friday Close', style=plot.style_linebr, linewidth=2, color=color.new(color.blue, 0))
plot2 = plot(close, 'Dummy plot for background', color=na)
fill(plot1, plot2, title='Background', color=close > cmeClose ? color.new(color.green, 80) : close < cmeClose ? color.new(color.red, 80) : na)

উপরে ETH প্রতিস্থাপন কোডটি রয়েছে।

আপনি এটি ট্রেডিংভিউ-এর PINE এডিটরে পেস্ট করে ব্যবহার করতে পারবেন।

CME গ্যাপ বলতে শিকাগো মার্কেন্টাইল এক্সচেঞ্জ বন্ধ হওয়ার পর আবার খোলার সময় দামের পূর্বাবস্থায় ফিরে আসাকে বোঝায়, তাই এটি বেশ কার্যকর বলে মনে হচ্ছে।

নীল → বাজার বন্ধ হওয়ার পর অতিরিক্ত মূল্যায়নের কারণে নিম্নমুখী গ্যাপ সহ পতন।

লাল = বাজার বন্ধ হওয়ার পর অবমূল্যায়নের কারণে ঊর্ধ্বমুখী গ্যাপ সহ বৃদ্ধি।

একইভাবে।

সপ্তাহের দিনগুলিতে ঘোরানোর জন্য একটি বট তৈরি করা হচ্ছে।