TradingView用のpinescriptを貼るスレat TECH
TradingView用のpinescriptを貼るスレ - 暇つぶし2ch1:デフォルトの名無しさん
24/09/25 20:25:24.69 RktVn9Q/U
Pineスクリプトとは何ですか?
URLリンク(jp.tradingview.com)

Pineスクリプト® 言語リファレンス
URLリンク(jp.tradingview.com)

TradingView PC版
URLリンク(jp.tradingview.com)

pinescript入門
URLリンク(tradingview.blog.fc2.com)


分からない時はchatGPT
URLリンク(chatgpt.com)

2:デフォルトの名無しさん
24/09/25 20:45:37.70 RktVn9Q/U
//@version=5
indicator("Custom MACD", overlay=false)

// パラメータ
fastLength = input(12, title="Fast Length")
slowLength = input(26, title="Slow Length")
signalSmoothing = input(9, title="Signal Smoothing")

// MACD計算
[macdLine, signalLine, _] = ta.macd(close, fastLength, slowLength, signalSmoothing)
histogram = macdLine - signalLine

// プロット
plot(macdLine, title="MACD Line", color=color.red)
plot(signalLine, title="Signal Line", color=color.blue)
plot(histogram, title="Histogram", color=color.green, style=plot.style_histogram)

hline(0, "Zero Line", color=color.gray)

3:デフォルトの名無しさん
24/09/25 20:47:17.94 RktVn9Q/U
//犬の絵を描くスクリプト、うまく動かない

//@version=5
indicator("Dog Drawing", overlay=true)

// 犬の形を描くための点を定義
var float[] x = na
var float[] y = na

if (bar_index == 0) // 初回実行時にデータを初期化
x := array.new_float(0)
y := array.new_float(0)

// 犬の形状を描く座標
array.push(x, 0)
array.push(y, 1)

array.push(x, -0.5)
array.push(y, 0)

array.push(x, 0)
array.push(y, -1)

array.push(x, 0.5)
array.push(y, 0)

// 線を描く
for i = 0 to array.size(x) - 2
line.new(x[array.get(x, i)], y[array.get(y, i)], x[array.get(x, i + 1)], y[array.get(y, i + 1)], color=color.black)

4:デフォルトの名無しさん
24/09/28 20:06:29.16 g90xtJ2Hk
//犬のアドベンチャーゲーム
//@version=5
indicator("Dog Adventure Game", overlay=false)

// ユーザー入力
choice = input.string("Choose your action: (1) Walk (2) Fetch (3) Sleep", title="Action")

// 結果メッセージ
var string outcome = na

if choice == "1"
outcome := "You and your dog go for a nice walk. The dog finds a new friend!"
else if choice == "2"
outcome := "Your dog brings back a stick and seems very happy!"
else if choice == "3"
outcome := "Your dog takes a nap and dreams of chasing squirrels."
else
outcome := "Invalid choice. Please select 1, 2, or 3."

// メッセージをプロット
label.new(bar_index, close, outcome, color=color.orange, style=label.style_label_down)

5:デフォルトの名無しさん
24/09/28 20:23:38.22 g90xtJ2Hk
//@version=5
input_number = input(1, "選択肢を入力 (1: 散歩, 2: 食事)")
var string choice = na
if input_number == 1
choice := "犬と散歩に行きました!"
else if input_number == 2
choice := "犬に食事をあげました!"
else
choice := "無効な選択肢です。"

label.new(bar_index, high, choice, color=color.blue, textcolor=color.white)

6:デフォルトの名無しさん
24/09/28 20:24:14.62 g90xtJ2Hk
//@version=5
indicator("Dog Adventure Game", overlay=false)

// 入力の選択肢
option = input.string("犬の冒険を開始するには、'冒険'と入力してください。", title="選択肢")

// ゲームのストーリー
if option == "冒険"
label.new(bar_index, na, "犬が森に入る。右に行くか、左に行くか選んでください。", color=color.green)
else if option == "右"
label.new(bar_index, na, "犬は右に行き、川に出会う。泳ぐか、橋を渡るか?", color=color.blue)
else if option == "左"
label.new(bar_index, na, "犬は左に行き、洞窟を見つける。入るか、戻るか?", color=color.red)

7:デフォルトの名無しさん
24/09/30 07:49:21.39 OmTbETCwB
//@version=5
indicator("犬の冒険ゲーム", overlay=false)

// ゲームの状態を管理
var string state = "start"
var int happiness = 50

// ユーザー入力
input_string("行動を選んでください: (散歩, 餌, 遊ぶ)", "行動")

if state == "start"
if input == "散歩"
happiness += 10
state := "after_walk"
else if input == "餌"
happiness += 5
state := "after_feed"
else if input == "遊ぶ"
happiness += 15
state := "after_play"

if state == "after_walk"
label.new(bar_index, na, "犬を散歩しました!幸福度: " + str.tostring(happiness))
state := "start"

if state == "after_feed"
label.new(bar_index, na, "犬に餌をあげました!幸福度: " + str.tostring(happiness))
state := "start"

if state == "after_play"
label.new(bar_index, na, "犬と遊びました!幸福度: " + str.tostring(happiness))
state := "start"

8:デフォルトの名無しさん
24/09/30 07:50:16.27 OmTbETCwB
//@version=5
indicator("Dog Adventure Game", overlay=false)

// ゲームの状態を管理
var string state = "start"
var int happiness = 50

// ユーザー入力
input_string("Choose an action: (walk, feed, play)", "Action")

if state == "start"
if input == "walk"
happiness += 10
state := "after_walk"
else if input == "feed"
happiness += 5
state := "after_feed"
else if input == "play"
happiness += 15
state := "after_play"

if state == "after_walk"
label.new(bar_index, na, "You took your dog for a walk! Happiness: " + str.tostring(happiness))
state := "start"

if state == "after_feed"
label.new(bar_index, na, "You fed your dog! Happiness: " + str.tostring(happiness))
state := "start"

if state == "after_play"
label.new(bar_index, na, "You played with your dog! Happiness: " + str.tostring(happiness))
state := "start"

9:デフォルトの名無しさん
24/10/02 18:11:06.77 Ur0qm7cmr
株は銘柄ごとに合わせたForecastを使えばいい
どのForecastが良いかは
良くグラフを観察することだ


最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch