TradingVue中用Mine Script语言编写1024程序员节日快乐!

1024程序员节(1024 Programmer's Day),又称“码农节”、中国程序员节,指每年10月24日是中国广大程序员的共同节日,是信息技术(IT)从业者自发设立、约定成俗的节日。
从2015年起,每年10月24日被传智播客定义为程序员节。选择10月24日还因为1024是程序员熟悉的数字,也可以说1024是程序员的一个代表。1024是2的十次方,二进制计数的基本计量单位之一,是程序员每天都在打交道的数字。在数字世界里1024BYTE(字节)=1KB,1024 KB=1MB,1024 MB=1GB等等。同时,1024MB是1GB,而1GB与1级谐音,也有一级棒的意思。
在TradingVue中用Mine Script语言编写1024程序员节日快乐!

// This Mine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © 老境


//@version=6
indicator("Happy Programmer's Day", overlay = true, scale = scale.none)

var tbl = table.new(position.top_center, 100, 100)
new_year_emojis = array.from('🎆', '🥂', '🎉', '🕛', '🍾', '👨‍💻', '🚀', '🥳', '🌟', '🎇')


Make_Triangle(int i, int j) =>
    t = int(math.random(0, new_year_emojis.size()))
    t1 = int(math.random(0, 3))

    if (t1 % 3 == 0)
        table.cell(tbl, i, j, new_year_emojis.get(t), bgcolor = color.new(color.green, 100), text_size = 25)

Make_Triangle2(Start_Index, End_Index,  Start_Price, End_Price, Color)=>
    Points = array.new<chart.point>()
    Mid_Index    = int((Start_Index + End_Index)/2 )

    Points.push(chart.point.from_index( Start_Index,  End_Price   ) )
    Points.push(chart.point.from_index( Mid_Index,    Start_Price ) )
    Points.push(chart.point.from_index( End_Index,    End_Price   ) )
    varip Lighting = 1
    if Lighting==1
        Lighting := 2
    else if Lighting==2
        Lighting := 1

    polyline.new( Points, false, true, xloc.bar_index, color.yellow, Color, line.style_arrow_both, Lighting )


Make_Tree(Start_Index = bar_index, Start_Price=0)=>
    Make_Triangle(72, 50)
    Make_Triangle(65, 30)
    Make_Triangle(88, 35)
    Make_Triangle(97, 65)
    Make_Triangle(50, 70)
    Make_Triangle(65, 50)
    Make_Triangle(78, 31)
    Make_Triangle(45, 60)
    //box.new(Start_Index-25, Start_Price+50, Start_Index+25, Start_Price+0, bgcolor=#6B492B, border_color = #6B492B )

    varip Lighting = 1
    if Lighting==1
        Lighting := 2
    else if Lighting==2
        Lighting := 1
    Light_Col_1 = color.yellow
    Light_Col_2 = color.red
    Light_Col_3 = color.white
    Light_Col_4 = color.blue


    label.new(Start_Index+300, Start_Price-250,  "", color=Lighting==1 ? Light_Col_1 : Light_Col_2,  style = label.style_circle      , size=size.tiny )
    label.new(Start_Index-300, Start_Price-250,  "", color=Lighting==1 ? Light_Col_2 : Light_Col_1,  style = label.style_circle      , size=size.tiny )

    label.new(Start_Index-190, Start_Price+75,  "", color=Lighting==1 ? Light_Col_1 : Light_Col_2,  style = label.style_circle      , size=size.tiny )
    label.new(Start_Index+0,   Start_Price+175,  "", color=Lighting==1 ? Light_Col_3 : Light_Col_4,  style = label.style_circle      , size=size.tiny )
    label.new(Start_Index+190, Start_Price+75,  "", color=Lighting==1 ? Light_Col_2 : Light_Col_1,  style = label.style_circle      , size=size.tiny )

    label.new(Start_Index+100, Start_Price+100, "", color=Lighting==1 ? Light_Col_1 : Light_Col_2,  style = label.style_circle      , size=size.tiny )

    label.new(Start_Index-100, Start_Price+100, "", color=Lighting==1 ? Light_Col_2 : Light_Col_1,  style = label.style_circle      , size=size.tiny )

    label.new(Start_Index-165, Start_Price-525, "", color=Lighting==1 ? Light_Col_1 : Light_Col_2,  style = label.style_circle      , size=size.tiny )
    label.new(Start_Index+0,   Start_Price-725, "", color=Lighting==1 ? Light_Col_3 : Light_Col_4,  style = label.style_circle      , size=size.tiny )
    label.new(Start_Index+165, Start_Price-525, "", color=Lighting==1 ? Light_Col_2 : Light_Col_1,  style = label.style_circle      , size=size.tiny )

    Wishing =   "👨‍💻  Happy Programmer's Day 1024! 🚀\n\n"
             + "\n亲爱的程序员们,1024程序员节快乐\n"
             + "\n愿你们的代码如诗般优雅,bug永世不扰,灵感爆棚。\n"
             + "\n1024,愿你们的咖啡永不凉,commit 记录闪耀星辰,继续用技术点亮未来!\n "
    Wishing  +=  "\n"
    Wishing  +=  Lighting==1 ?  "\n🌟 🎁 🌟 🎁 🌟 🎁" : "🎁 🌟 🎁 🌟 🎁 🌟"
    label.new(Start_Index, 200, Wishing, textcolor=Lighting==1 ? Light_Col_3 : Light_Col_1,  style = label.style_text_outline, size=size.large, color=color.gray )


Snow_Flake()=>
    snowflakeCount = input(25, "Snow Flakes Counte")
    for i = 0 to snowflakeCount - 1
        x = int(bar_index - math.random(-400, 800))
        y = math.random(-400, 800)
        label.new(x, y, text="✨", color = color.new(color.white, 100), textcolor=color.white, size=size.tiny)


if barstate.islast
    Make_Tree(Start_Index = bar_index[150],      Start_Price=400)
    // Make_Tree(Start_Index = bar_index+200,  Start_Price=100)
    // Make_Tree(Start_Index = bar_index+400,  Start_Price=0)
    Snow_Flake()


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值