Edit Your Comment
How to read data of latest 2 bar
Členom od May 02, 2012
15 príspevkov
Jun 27, 2014 at 13:53
Členom od May 02, 2012
15 príspevkov
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.
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.
Členom od May 02, 2013
90 príspevkov
Jun 29, 2014 at 08:36
(upravené Jun 29, 2014 at 08:36)
Členom od May 02, 2013
90 príspevkov
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.
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

*Komerčné použitie a spam nebudú tolerované a môžu viesť k zrušeniu účtu.
Tip: Uverejnením adresy URL obrázku /služby YouTube sa automaticky vloží do vášho príspevku!
Tip: Zadajte znak @, aby ste automaticky vyplnili meno používateľa, ktorý sa zúčastňuje tejto diskusie.