Multiple Timeframes - Intraday Settings

I would like to be able to call on the daily time frame for a simple gap up strategy. The issue I am running into is that when I use the TimeFrameGetPrice function (see below), the compression of intraday data just doesn't seem to work. I have tried all different combinations of settings in the Intraday Database Settings that should give me OHLCV for the day. I don't really understand what I'm doing wrong or if maybe I need to separate out my intraday data, or if it's something else entirely. I only trade equities for reference (if that matters)

Note: I am not concerned with the rest of the code at this time. I mostly just want to get the intraday data to compress properly so I can at least test the code (and probably fix later). I have really just been caught up with the TimeFrameGetPrice portion of the code and running this code in Explore

SetOption("InitialEquity",100000);										// Adjust starting equity
PercentRiskPerTrade = 1;												// Percentage of account being risked per trade

GapPct = 1.50;															// 50%+ Gappers
MarketCap = Close * GetFnData( "SharesOut" );							//Market Cap Calc
//PM_Vol > 1000000;

//Switch to Daily

TimeFrameSet(inDaily);
DailyCond1 = O >= GapPct*Ref(C,-1);										// 50%+ Gap
DailyCond2 = O > .1;													// Greater than $0.10
DailyCond3 = O < 15;													// Less than $15
DClose = C;
TimeFrameRestore();

//Expand in 1min
DailyCond1 = TimeFrameExpand(DailyCond1,inDaily);
DailyCond2 = TimeFrameExpand(DailyCond2,inDaily);
DailyCond3 = TimeFrameExpand(DailyCond3,inDaily);
DClose = TimeFrameExpand(DClose,inDaily);
Buy=Sell=0;


ShortPrice = TimeFrameGetPrice("O",inDaily);
CoverPrice = TimeFrameGetPrice("C",inDaily);
Short = DailyCond1
	AND DailyCond2
	AND DailyCond3
	AND MarketCap < 100000000;
	
Cover = DClose;

Filter =1;
AddColumn(TimeFrameGetPrice("O",inDaily),"Open"); 
AddColumn(TimeFrameGetPrice("H",inDaily),"High"); 
AddColumn(TimeFrameGetPrice("L",inDaily),"Low"); 
AddColumn(TimeFrameGetPrice("C",inDaily,-1),"Close"); 
AddColumn(TimeFrameGetPrice("V",inDaily),"Volume",1.0); 
AddColumn(TimeFrameGetPrice("C",inDaily,-1),"P-Close");
SetOption("InitialEquity",100000);										// Adjust starting equity
PercentRiskPerTrade = 1;												// Percentage of account being risked per trade

GapPct = 1.50;															// 50%+ Gappers
MarketCap = Close * GetFnData( "SharesOut" );							//Market Cap Calc
//PM_Vol > 1000000;

//Switch to Daily

TimeFrameSet(inDaily);
DailyCond1 = O >= GapPct*Ref(C,-1);										// 50%+ Gap
DailyCond2 = O > .1;													// Greater than $0.10
DailyCond3 = O < 15;													// Less than $15
DClose = C;
TimeFrameRestore();

//Expand in 1min
DailyCond1 = TimeFrameExpand(DailyCond1,inDaily);
DailyCond2 = TimeFrameExpand(DailyCond2,inDaily);
DailyCond3 = TimeFrameExpand(DailyCond3,inDaily);
DClose = TimeFrameExpand(DClose,inDaily);
Buy=Sell=0;


ShortPrice = TimeFrameGetPrice("O",inDaily);
CoverPrice = TimeFrameGetPrice("C",inDaily);
Short = DailyCond1
	AND DailyCond2
	AND DailyCond3
	AND MarketCap < 100000000;
	
Cover = DClose;

Filter =1;
AddColumn(TimeFrameGetPrice("O",inDaily),"Open"); 
AddColumn(TimeFrameGetPrice("H",inDaily),"High"); 
AddColumn(TimeFrameGetPrice("L",inDaily),"Low"); 
AddColumn(TimeFrameGetPrice("C",inDaily,-1),"Close"); 
AddColumn(TimeFrameGetPrice("V",inDaily),"Volume",1.0); 
AddColumn(TimeFrameGetPrice("C",inDaily,-1),"P-Close");

Below are the results that I get and the current settings I have both in the backtester and the database settings. I am testing on FWBI specifically because I know it was a previous trade that I can at least test the code on. The very last image shows when I change my periodicity to Daily and the OHLCV values that I should be getting



(Expected Values)
image

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.