Hello Friends,
first of all, sorry for the my poor English.
i have one doubt for timeframe in in1Second & inDaily @ intraday, which both timeframe need to use together. but i try code OHLC value, not showing.
i need 3 value OHLC
- Yesterday OHLC value
- today our market open time 91500, need OHLC value.
- starttime 91500 to endtime 93000 value OHLC.
see the below screenshot.
SetBarsRequired( sbrAll, sbrAll );
TimeFrameMode(1);
TimeFrameSet(inDaily);
inO = TimeFrameGetPrice( "O", inDaily, -1 );
inH = TimeFrameGetPrice( "H", inDaily, -1 );
inL = TimeFrameGetPrice( "L", inDaily, -1 );
inC = TimeFrameGetPrice( "C", inDaily, -1 );
for( i = 1; i < BarCount ; i++ )
{
LastO[i] = inO[i];
LastH[i] = inH[i];
LastL[i] = inL[i];
LastC[i] = inC[i];
range[i] = LastH[i] - LastL[i];
}
TimeFrameRestore();
POpen = TimeFrameExpand( TimeFrameCompress( LastO, inDaily, compressOpen), inDaily, expandFirst);
PHigh = TimeFrameExpand( TimeFrameCompress( LastH, inDaily, compressHigh), inDaily, expandFirst);
PLow = TimeFrameExpand( TimeFrameCompress( LastL, inDaily, compressLow), inDaily, expandFirst);
PClose = TimeFrameExpand( TimeFrameCompress( LastC, inDaily, compressLast), inDaily, expandFirst);
PRange = TimeFrameExpand( TimeFrameCompress( range, inDaily, compressLast), inDaily, expandFirst);
TimeFrameMode(1);
TimeFrameSet( in1Second );
NewDay = Day() != Ref(Day(),-1);
BT1 = 91500; //BT = Param("BreakoutTime",93000,09000,120000);
HighValue=HighestSince(newDay AND BT1,H);
LowValue=LowestSince(newDay AND BT1,L);
// 9:15am Value
DayO=ValueWhen(NewDay,O);//Todays Open
DayH=ValueWhen(NewDay,H);//Todays opening Hign
DayL=ValueWhen(NewDay,L);//Todays opening Low
DayC=ValueWhen(NewDay,C);//Todays opening CLOSE
TimeFrameRestore();
// 9:15am Value
PreOpen = TimeFrameExpand( TimeFrameCompress(DayO,in1Second,compressOpen), in1Second,expandFirst);
PreHigh = TimeFrameExpand( TimeFrameCompress(DayH,in1Second,compressHigh), in1Second,expandLast);
PreLow = TimeFrameExpand( TimeFrameCompress(DayL,in1Second,compressLow), in1Second,expandLast);
PreClose = TimeFrameExpand( TimeFrameCompress(DayC,in1Second,compressLast), in1Second,expandLast);
textsize = Param("TextSize",9,6,20,1,0);
GfxSetOverlayMode(0);
GfxSelectFont("Trebuchet MS",textsize, 700);
GfxSetBkMode(0); // transparent
GfxSetTextAlign(0);
GfxSetTextColor( colorCustom16 );
GfxTextOut("High", 90, 12);
GfxTextOut("Low" , 150, 12);
GfxTextOut("Close", 210, 12);
GfxTextOut("Yesterday ", 0, 25);
GfxTextOut("Rate@9:15AM ", 0, 40);
GfxTextOut("Rate@9:30AM ", 0, 55);
GfxSetTextColor( colorblue );
GfxTextOut("" + PHigh, 85, 25);
GfxTextOut("" + PLow, 145, 25);
GfxTextOut("" + PClose, 205, 25);
GfxTextOut(""+PreHigh, 85, 40);
GfxTextOut(""+PreLow, 145, 40);
GfxTextOut(""+PreClose, 205, 40);