Profile Picture

Enter on open and exit on close

Posted By clawson84 8 Years Ago
Message
Posted Friday June 19 2009
I've just started to use Right Edge and I find it a little bit too simplistic. I have used OpenQuant before which has methods for different events on a bar, e.g. open and close. This works well for me as I would like to test some simple strategies where I enter on open and exit on close of a bar. Is it possible to do this in RE as well, as I haven't been able to figure it out yet.

Thanks
Posted Friday June 19 2009
Not easily done with Edition 1, however, with Edition 2, the bars are broken apart into ticks where 4 ticks would be sent per bar (Open, High, Low, Close). So in that case you'd handle NewTick and you'd keep track of which tick came through and process.

Off the top of my head, something like;

int tickCount = 1;

public void override NewTick(Symbol symbol, BarData partialBar, TickData tick)
{
if (tickCount == 1)
{
// This is my opening price tick
}

if (tickCount == 4)
{
// this is my closing price tick.
}

tickCount++;
}

public void override NewBar()
{
// Reset the counter now that we've received a full bar
tickCount = 1;
}

clawson84 (6/19/2009)
I've just started to use Right Edge and I find it a little bit too simplistic. I have used OpenQuant before which has methods for different events on a bar, e.g. open and close. This works well for me as I would like to test some simple strategies where I enter on open and exit on close of a bar. Is it possible to do this in RE as well, as I haven't been able to figure it out yet.

Thanks
Posted Tuesday June 30 2009
Thanks for your help,

I've tried to implement a function with the same signature that you've given in the sample but I get a compile error as follows.

I'm using Edition 2 Build 11

Error   'MySymbolScript.NewTick(RightEdge.Common.Symbol, RightEdge.Common.BarData, RightEdge.Common.TickData)': no suitable method found to override   c:\XXXXXXXXX.cs   84
Posted Tuesday June 30 2009
This override would have to be at the System level, not the SymbolScript level. To do something similar at the SymbolScript level, tap into NewTick.

clawson84 (6/30/2009)
Thanks for your help,

I've tried to implement a function with the same signature that you've given in the sample but I get a compile error as follows.

I'm using Edition 2 Build 11

Error   'MySymbolScript.NewTick(RightEdge.Common.Symbol, RightEdge.Common.BarData, RightEdge.Common.TickData)': no suitable method found to override   c:\XXXXXXXXX.cs   84
Posted Friday September 18 2009
Why, when CreateTicksFromBars is set to true, the tickType enumeration is set always to Trade instead of PriceOpen, PriceLow, PriceHigh, PriceClose respectively for four ticks representing one bar?
Posted Friday September 18 2009
vanSant (9/18/2009)
Why, when CreateTicksFromBars is set to true, the tickType enumeration is set always to Trade instead of PriceOpen, PriceLow, PriceHigh, PriceClose respectively for four ticks representing one bar?


Well, we try to design RightEdge so that the same systems will work for backtesting and live mode. In live mode you will be getting trade ticks, not OHLC ticks, so it does the same in backtest mode. We have tick types for HighPrice, LowPrice, OpenPrice, and PreviousClose, but these are there so that these values can be displayed in the live data window, and aren't really meant to be used by the system.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems