搜尋
產品
社群
市場
新聞
經紀商
更多
TW
立即開始
美元 / 日圓
教育
已更新
2019年7月26日
Pine講座㉘ バックテスト|未決済を含めた残高を時系列で表示する
2
6
取得這個圖表
取得這個圖表
2019年7月23日
前回、表示させた残高は「決済済みだけの残高」でした。
今回は「未決済(取引中)の損益も含めた残高」を表示させます。
(取引会社によって各社の表現が異なるので難しいのですが、、英語だと「account value」とされる項目です)
TradingViewでは、この資金量に応じて取引量を調整するようなロジックを組むこともできます。
=====
//
version
=4
strategy( "MovingAvg2Line Cross" )
fastLength = input( 9 )
slowLength = input( 18 )
price = close
balance = strategy.initial_capital + strategy.netprofit
// ここで未決済を含む残高を算出
accountValue = balance + strategy.openprofit
mafast = sma( price ,fastLength )
maslow = sma( price ,slowLength )
if ( crossover( mafast ,maslow ) )
strategy.entry( "MA2CrossLE" ,strategy.long ,comment="MA2CrossLE" )
if ( crossunder( mafast, maslow ) )
strategy.entry( "MA2CrossSE" ,strategy.short ,comment="MA2CrossSE" )
plot( strategy.initial_capital )
plot( balance )
// 描画する
plot( accountValue ,color=color.red)
=====
2019年7月26日
註釋
strategy.equity
も用意されています
strategy.initial_capital + strategy.netprofit + strategy.openprofit
2019年8月1日
註釋
次の講座
yuya_takahashi_
關注
小次郎講師公式インジケーターのお申込
bit.ly/2vdSV4Q
小次郎講師のLINE@
bit.ly/2VZQFu3
小次郎講師のチャート情報局
bit.ly/2GvLAEp
更多:
Beyond Technical Analysis
pinescript
yuya_takahashi_
關注
小次郎講師公式インジケーターのお申込
bit.ly/2vdSV4Q
小次郎講師のLINE@
bit.ly/2VZQFu3
小次郎講師のチャート情報局
bit.ly/2GvLAEp
更多:
相關出版品
Pine講座⑱ 複数の相関を表示する
由yuya_takahashi_提供
Pine講座⑲ 2行でlabelを表示する
由yuya_takahashi_提供
Pine講座⑳ labelでインフォパネルを表示する
由yuya_takahashi_提供
Pine講座㉑ ラインを表示する
由yuya_takahashi_提供
Pine講座㉒ ラインとラベルを組み合わせる
由yuya_takahashi_提供
Pine講座㉓ 終値から ±2-ATR にラインを描画する
由yuya_takahashi_提供
Pine講座㉔ 取引量を算出してインフォパネルに表示する
由yuya_takahashi_提供
Pine講座㉕ TradingViewでバックテストをする
由yuya_takahashi_提供
Pine講座㉖ バックテスト|2本のSMAで途転
由yuya_takahashi_提供
Pine講座㉗ バックテスト|残高の推移を時系列で表示する
由yuya_takahashi_提供
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在
使用條款
閱讀更多資訊。