<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Pine Script v5 on TradingViewの教科書</title><link>https://trading-view.info/docs/pine_script_v5/</link><description>Recent content in Pine Script v5 on TradingViewの教科書</description><generator>Hugo -- gohugo.io</generator><language>ja</language><atom:link href="https://trading-view.info/docs/pine_script_v5/index.xml" rel="self" type="application/rss+xml"/><item><title>New</title><link>https://trading-view.info/docs/pine_script_v5/New/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/New/</guid><description>=&amp;gt; # The &amp;lsquo;=&amp;gt;&amp;rsquo; operator is used in user-defined function declarations and in switch statements.
&amp;lt;identifier&amp;gt;([&amp;lt;parameter_name&amp;gt;[=&amp;lt;default_value&amp;gt;]], ...) =&amp;gt; &amp;lt;local_block&amp;gt; &amp;lt;function_result&amp;gt; 例 # // single-line function f1(x, y) =&amp;gt; x + y // multi-line function f2(x, y) =&amp;gt; sum = x + y sumChange = ta.change(sum, 10) // Function automatically returns the last expression used in it 備考 # You can learn more about user-defined functions in the User Manual&amp;rsquo;s pages on Declaring functions and Libraries.</description></item><item><title>OHLC</title><link>https://trading-view.info/docs/pine_script_v5/OHLC/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/OHLC/</guid><description>close # 現在のバーがクローズした時の終値価格、または取引中のリアルタイムバーの最終取引価格。
備考 # 以前の値は、角括弧[]でアクセスすることができます。 例えばclose[1]、close[2]です。
関連 # open, high, low, volume, time, hl2, hlc3, ohlc4
high # 現在の高値。
備考 # 以前の値は、角括弧[]でアクセスすることができます。例えばhigh[1]、high[2]です。
関連 # open, low, close, volume, time, hl2, hlc3, ohlc4
hl2 # ショートカットは(高値+安値)/2
関連 # open, high, low, close, volume, time, hlc3, ohlc4
hlc3 # ショートカットは(高値+安値+終値)/3
関連 # open, high, low, close, volume, time, hl2, ohlc4</description></item><item><title>アラート</title><link>https://trading-view.info/docs/pine_script_v5/%E3%82%A2%E3%83%A9%E3%83%BC%E3%83%88/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E3%82%A2%E3%83%A9%E3%83%BC%E3%83%88/</guid><description>alert # Triggers an alert event when called during the real-time bar and an alert based on alert function events was previously created for the indicator or strategy through the “Create Alert” dialog box.
alert(message, freq) → void 引数 # message (series string) アラートがトリガーされた時に送信されるメッセージ。必須の引数です。 freq (input string) トリガー頻度。可能な値は alert.freq_all (すべての関数呼び出しがアラートをトリガー), alert.freq_once_per_bar (バー内の最初の関数の呼び出しがアラートをトリガー), alert.freq_once_per_bar_close (リアルタイムバーでバーがクローズする際の最後のスクリプトの実行中に発生した場合のみアラートをトリガー) です。デフォルトは alert.freq_once_per_bar です。 例 # //@version=5 indicator(&amp;#34;`alert()` example&amp;#34;, &amp;#34;&amp;#34;, true) ma = ta.</description></item><item><title>ストラテジー</title><link>https://trading-view.info/docs/pine_script_v5/%E3%82%B9%E3%83%88%E3%83%A9%E3%83%86%E3%82%B8%E3%83%BC/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E3%82%B9%E3%83%88%E3%83%A9%E3%83%86%E3%82%B8%E3%83%BC/</guid><description>input # Adds an input to the Inputs tab of your script&amp;rsquo;s Settings, which allows you to provide configuration options to script users. This function automatically detects the type of the argument used for &amp;lsquo;defval&amp;rsquo; and uses the corresponding input widget.
input(defval, title, tooltip, inline, group) → input bool input(defval, title, tooltip, inline, group) → input color input(defval, title, tooltip, inline, group) → input int input(defval, title, tooltip, inline, group) → input float input(defval, title, tooltip, inline, group) → input string input(defval, title, inline, group, tooltip) → series float 戻り値 # input変数の値。</description></item><item><title>バー</title><link>https://trading-view.info/docs/pine_script_v5/%E3%83%90%E3%83%BC/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E3%83%90%E3%83%BC/</guid><description>bar_index # 現在のバーのインデックス。ナンバリングは0から始まり、最初のバーのインデックスは0です。
例 # plot(bar_index) plot(bar_index &amp;gt; 5000 ? close : 0) 備考 # バージョン4では、n変数はbar_indexに置き換えられている事にご注意ください。
バーのインデックスは、最初の過去バーから0で始まることにご注意ください。
この変数/関数を使用すると、インジケーターのリペイントが発生する可能性がある事にご注意下さい。
max_bars_back # 関数は、指定されたビルトインまたはユーザー変数の、履歴参照に利用できるバーの最大数を設定します。演算子 &amp;lsquo;[]&amp;rsquo; が変数に適用される場合、その変数の過去の値が参照されます。
max_bars_back(var, num) → void 戻り値 # void
引数 # var (series int/float/bool/color/label/line) 履歴バッファのサイズを変更する系列変数の識別子。可能な値は: &amp;lsquo;open&amp;rsquo;, &amp;lsquo;high&amp;rsquo;, &amp;lsquo;low&amp;rsquo;, &amp;lsquo;close&amp;rsquo;, &amp;lsquo;volume&amp;rsquo;, &amp;lsquo;time&amp;rsquo;, または任意のユーザー定義変数のIDです。 num (literal int) History buffer size which is the number of bars that could be referenced for variable &amp;lsquo;var&amp;rsquo;.</description></item><item><title>プロット</title><link>https://trading-view.info/docs/pine_script_v5/%E3%83%97%E3%83%AD%E3%83%83%E3%83%88/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E3%83%97%E3%83%AD%E3%83%83%E3%83%88/</guid><description>plot # チャート上に一連のデータを描写します。
plot(series, title, color, linewidth, style, trackprice, histbase, offset, join, editable, show_last, display) → plot 戻り値 # fillで使用できる描写オブジェクト
引数 # series (series int/float) 描写されるデータ形式。 必須の引数。 title (const string) plotのタイトル。 color (series color) plotの色。&amp;lsquo;color=color.red&amp;rsquo; や &amp;lsquo;color=#ff001a&amp;rsquo; といった定数や &amp;lsquo;color = close &amp;gt;= open ? color.green : color.red&amp;rsquo; の様な複雑な式を利用できます。オプション引数。 linewidth (input int) プロットされた線の幅。デフォルト値は1です。すべてのスタイルに適用できるわけではありません。 style (plot_style) プロットの種類。利用可能な値は plot.</description></item><item><title>型</title><link>https://trading-view.info/docs/pine_script_v5/%E5%9E%8B/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E5%9E%8B/</guid><description>bool # naをboolに型変換
bool(x) → const bool bool(x) → input bool bool(x) → simple bool bool(x) → series bool 戻り値 # boolに型変換された後の引数の値
関連 # float, int, color, string, line, label
color # naをcolorに型変換
color(x) → const color color(x) → input color color(x) → simple color color(x) → series color 戻り値 # colorに型変換された後の引数の値
関連 # float, int, bool, string, line, label
float # naをfloatに型変換</description></item><item><title>基本構文</title><link>https://trading-view.info/docs/pine_script_v5/%E5%9F%BA%E6%9C%AC%E6%A7%8B%E6%96%87/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E5%9F%BA%E6%9C%AC%E6%A7%8B%E6%96%87/</guid><description>?: # 三項条件演算子。
expr1 ? expr2 : expr3 戻り値 # もしexpr1がtrueであればexpr2、そうでなければexpr3。 ゼロ値(0またはNaN、+ Infinity、-Infinity)はfalseとみなされ、他の値はtrueです。
例 # // Draw circles at the bars where open crosses close s2 = ta.cross(open, close) ? math.avg(open,close) : na plot(s2, style=plot.style_circles, linewidth=2, color=color.red) // Combination of ?: operators for &amp;#39;switch&amp;#39;-like logic c = timeframe.isintraday ? color.red : timeframe.isdaily ? color.green : timeframe.isweekly ? color.blue : color.gray plot(hl2, color=c) 備考 # 必要がない場合は、 &amp;lsquo;else&amp;rsquo;分岐にnaを使用してください。</description></item><item><title>変換</title><link>https://trading-view.info/docs/pine_script_v5/%E5%A4%89%E6%8F%9B/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E5%A4%89%E6%8F%9B/</guid><description>box # naをboxに型変換
box(x) → series box 戻り値 # boxに型変換された後の引数の値。
関連 # float, int, bool, color, string, line, label</description></item><item><title>描画</title><link>https://trading-view.info/docs/pine_script_v5/%E6%8F%8F%E7%94%BB/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E6%8F%8F%E7%94%BB/</guid><description>barcolor # バーの色をセットする。
barcolor(color, offset, editable, show_last, title) → void 引数 # color (series color) バーの色。&amp;lsquo;color=color.red&amp;rsquo; や &amp;lsquo;color=#ff001a&amp;rsquo; といった定数や &amp;lsquo;color = close &amp;gt;= open ? color.green : color.red&amp;rsquo; の様な複雑な式を利用できます。必須引数。 offset (series int) 指定された数のバーでカラー形式を左または右に移動します。 デフォルトは0です。 editable (const bool) trueの場合、足の色の種類は書式ダイアログで編集可能です。デフォルトはtrueです。 show_last (input int) 設定されている場合は、チャートに記入する (最後のバーから過去の時点までの) バーの数を定義します。 title (const string) barcolorのタイトル。オプション引数です。 例 # barcolor(close &amp;lt; open ?</description></item><item><title>時間</title><link>https://trading-view.info/docs/pine_script_v5/%E6%99%82%E9%96%93/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E6%99%82%E9%96%93/</guid><description>dayofmonth # タイムゾーンの切り替えにおける現在の足の時間の日付。
備考 # この変数はバーの開始時刻に基づく日を返す事にご注意下さい。オーバーナイトセッションでは（例．月曜のセッションが日曜日の17:00 UTC-4に始まるEURUSD）、この値は取引日よりも1つ少なくなる可能性があります。
関連 # dayofmonth, time, year, month, weekofyear, dayofweek, hour, minute, second
dayofweek # タイムゾーンの切り替えにおける現在の足の時間の曜日。
備考 # この変数はバーの開始時刻に基づく日を返す事にご注意下さい。オーバーナイトセッションでは（例．月曜のセッションが日曜日の17:00 UTC-4に始まるEURUSD）、この値は取引日よりも1つ少なくなる可能性があります。
dayofweek.sunday, dayofweek.monday, dayofweek.tuesday, dayofweek.wednesday, dayofweek.thursday, dayofweek.friday, dayofweek.saturday変数を比較に利用できます。
関連 # dayofweek, time, year, month, weekofyear, dayofmonth, hour, minute, second
hour # タイムゾーンが変わる際の現在のバーの時間。
関連 # hour, time, year, month, weekofyear, dayofmonth, dayofweek, minute, second
minute # タイムゾーンが変わる際の現在のバーの分。</description></item><item><title>演算子</title><link>https://trading-view.info/docs/pine_script_v5/%E6%BC%94%E7%AE%97%E5%AD%90/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://trading-view.info/docs/pine_script_v5/%E6%BC%94%E7%AE%97%E5%AD%90/</guid><description>!= # 等しくない。 任意のタイプの式に適用できます。
expr1 != expr2 戻り値 # ブーリアン値、もしくはブーリアン値の系列
% # モジュロ (割り算の余り)。数式に適用できます。
expr1 % expr2 戻り値 # 整数または浮動小数点の値、もしくは系列値。
備考 # Pineスクリプトでは、整数の余りが計算されると商は切り捨てられます。つまり、最小絶対値に丸められます。 結果の値は被除数と同じ符号になります。
例: -1 % 9 = -1 - 9 * truncate(-1/9) = -1 - 9 * truncate(-0.111) = -1 - 9 * 0 = -1
%= # モジュロ (割り算の余り) の割り当て。数式に適用できます。
expr1 %= expr2 戻り値 # 整数または浮動小数点の値、もしくは系列値。
例 # // Equals to expr1 = expr1 % expr2.</description></item></channel></rss>