TradingView
yuya_takahashi_
2019年9月6日午前2時45分

Pine講座53 バックテストでエントリーも指値注文 教育

U.S. Dollar/Japanese YenFXCM

詳細

昨日の続きですが、
もちろんエントリーも指値(逆指値)で入ることができます。

・ブレイクアウト系
・逆張り系
・価格の明確な利益確定
・明確なロスカット

このあたりは、
ちゃんと指値注文を使ってあげると
少しだけ幸せになれるかもしれません。

※ 解説はコードの中で

※ コピペする場合は以下の変更を行ってください
[](全角の角括弧)→(半角の角括弧)
(全角スペース)→(半角スペース)

=====
//@version=4
strategy( "STOP LIMIT の解説" ,overlay=true )

entry1 = time[1] < timestamp(2019,9,5,6,00) and time >= timestamp(2019,9,5,6,00)
diff = time - time[1]

float entry_price = na
float exit_limit = na
float exit_stop = na

if( entry1 )
 entry_price := high
 exit_limit := entry_price + tr * 3
 exit_stop := entry_price - tr * 3
 line.new( time ,entry_price ,time+diff*30 ,entry_price ,xloc=xloc.bar_time ,color=color.red )
 line.new( time ,exit_limit ,time+diff*30 ,exit_limit ,xloc=xloc.bar_time ,color=color.red )
 line.new( time ,exit_stop ,time+diff*30 ,exit_stop ,xloc=xloc.bar_time ,color=color.red )
 strategy.entry( "Entry1" ,strategy.long ,1 ,stop=entry_price )
 strategy.exit( "Exit1" ,"Entry1" ,stop=exit_stop ,limit=exit_limit )
=====
詳細