Bars since order open
6 replies
glennc
6 years ago #191551
I want to refer to the bar when a pending order triggers a trade ie. where the pending order has become an actual open trade.
Using ‘order opened this bar’ will include pending orders, which I don’t want.
Using ‘market position is long/short’ will include all bars of the trade duration.
How do I achieve this?
Mark Fric
6 years ago #191560
this doesn’t look like something to configure in StrategyQuant 3, are you trying to build strategy like this in Wizard?
I think you can combine these two conditions- Order Opened This Bar AND Order Position Is Long.
If you’ll use specific Magic Number it should give you what you want, shouldn’t it?
Mark
StrategyQuant architect
glennc
6 years ago #191563
Thanks very much for your reply. Yes, I should have specified, sorry – this is building a strategy in Wizard.
If I use the two conditions, will the EA count the trade opening as an ‘order opened this bar’, even though the pending order was placed on previous bars?
tomas262
6 years ago #191659
Hello,
you can refer to that bar also using a simple bar counter. The bar counter will provide you with a number of bars in trade (barsInTrade variable). Then you can reference the bar prices like for example Close[barsInTrade]. See the file attached
glennc
6 years ago #191745
Thank you very much, that’s very clever.
Just for my understanding, is not the ‘is bar open’ function used in the example achieved by ticking the box ‘Evaluate rule on bar open only’,
or is this something different?
Thanks again, I appreciate you taking the time!
tomas262
6 years ago #191781
Hello,
these are the same. I like to use the condition especially in time when you do not have anything else to setup. You just need some action exactly on bar open
glennc
6 years ago #191807
OK, thank you very much.
Viewing 6 replies - 1 through 6 (of 6 total)