I am testing a simple crossover strategy that submit orders at the close of every candle that mean the criteria, for example,
protected override void Initialize()
{
EntriesPerDirection = 50;
EntryHandling = EntryHandling.UniqueEntries;
}
protected override void OnBarUpdate()
{
if (CrossAbove(SMA(10), SMA(20), 1)
EnterLongLimit(GetCurrentBid(), "SMA Cross Entry");
}
Suppose during the past 5 candles, all of them met the criteria, and 5 entry orders were filled at different prices, my question is if I want to use Position.AvgPrice later on in my strategy, will it calculate the average price of all the open positions, or the price of the latest entry( the fifth bar). And if I want to treat those five entries individually(perhaps using reverse on stop), how do I track the entry prices of the other previous entries( i.e., the first, the second, the third, the forth bar) ?
Thank you.

Comment