How to read data of latest 2 bar

Jun 27, 2014 at 13:53
489 視聴
1 Replies
May 02, 2012からメンバー   14 投稿
Jun 27, 2014 at 13:53
Hi everyone,

This might sound silly but can anyone provide me a short script to capture the OHLC of the latest 2 bar 😀

Thanks and have a pleasant weekend ahead.
May 02, 2013からメンバー   90 投稿
Jun 29, 2014 at 08:36 (編集済みのJun 29, 2014 at 08:36)
double bar1Close = Close[1], bar1Open = Open[1], bar1High = High[1], bar1Low = Low[1]; // bar prior to current bar
double bar2Close = Close[2], bar2Open = Open[2], bar2High = High[2], bar2Low = Low[2]; // 2 bars prior to current bar

If you want the current bar values it's simply a 0 eg, High[0], if you want the 3rd previous bar from current bar it's obviously a 3.

Hate your losers more than you like your winners
サインイン / 登録 to comment
You must be connected to Myfxbook in order to leave a comment
*商用利用やスパムは容認されていないので、アカウントが停止される可能性があります。
ヒント:画像/YouTubeのURLを投稿すると自動的に埋め込まれます!
ヒント:この討論に参加しているユーザー名をオートコンプリートするには、@記号を入力します。