SmartQuant Discussion
http://www.smartquant.com/forums/

compare bar price to trade price
http://www.smartquant.com/forums/viewtopic.php?f=44&t=9021
Page 1 of 1

Author:  jamesbond [ Wed Apr 06, 2011 8:24 pm ]
Post subject:  compare bar price to trade price

Hi, I would like to create a strategy condition using 5 min bar price and trade price. But They come from different event handlers ,onBar and onTrade.
Could you tell me what event handlers I need to use to handle those prices and volume ( bar price, trade price and size) together ? Thanks.

EX. if (Bars.Ago(1).Low > bbl.Ago(1) && Bars.Last.Low < bbl.Last) /*** Bar price **/
{
if ( Trade.Size > 100 && Trade.price < Bars.Last.Low ) /*** Trade price and Size**/

{
Buy();
}
}

Author:  Dr. Anton Fokin [ Wed Apr 06, 2011 9:11 pm ]
Post subject:  Re: compare bar price to trade price

I think you can move this logic into a separate method and call this method from both OnBar and OnTrade. Would this work?

Author:  jamesbond [ Wed Apr 06, 2011 9:40 pm ]
Post subject:  Re: compare bar price to trade price

Yes. Could you give an example for that ? Thanks!

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/