Posted By: kerplunk1899
Hourly bars / Daily prices - 04/27/20 17:26
Hi all,
could someone help me to implement the following?
I want my trades to be executed every day at 1 am based on the daily (midnight) bars prices.
I thought I could use FrameOffset, but it didn't get the expected result.
I'm not sure I understood what FrameOffset does exactly. Changing its value seems to make no difference at all.
What I want, is to get the green prices and not the red ones.
Can you please help me?
Is there a more correct way to set BarPeriod/TimeFrame in order to get the result??
Thanks!!!
could someone help me to implement the following?
I want my trades to be executed every day at 1 am based on the daily (midnight) bars prices.
Code
string datetime(){ return strf("%02d.%02d.%02d %02d:%02d:%02d %d",day(),month(),year(),hour(),minute(),(int)second(),dow()); } function run() { set(LOGFILE); LookBack = 0; BarPeriod = 60; assetList("AssetsFix"); StartDate = 20200410; asset("EUR/USD"); TimeFrame = 1; FrameOffset = 0; var open = priceOpen(); var close = priceClose(); printf("\n%s | Open=%.5f, Close=%.5f", datetime(), open, close); TimeFrame = 24; FrameOffset = 1; var open = priceOpen(); var close = priceClose(); if(hour()==1) printf(" | Open=%.5f, Close=%.5f", open, close); }
I thought I could use FrameOffset, but it didn't get the expected result.
I'm not sure I understood what FrameOffset does exactly. Changing its value seems to make no difference at all.
What I want, is to get the green prices and not the red ones.
Can you please help me?
Is there a more correct way to set BarPeriod/TimeFrame in order to get the result??
Thanks!!!