Calculate = calculate.OnBarClose
protected override void OnBarUpdate()
{
if (GetCurrentAsk() > PSAR[0] && tradeEntryBar != CurrentBar)
{
EnterLongLimit(0,true,TradeQuantity,PSAR, "myLongEntry");
tradeEntryBar = CurrentBar;
}
}
Calculate = calculate.OnEachTick
protected override void OnBarUpdate()
{
if (GetCurrentAsk() > PSAR[1] && tradeEntryBar != CurrentBar)
{
EnterLongLimit(0,true,TradeQuantity, AuSuperTrendU111.StopDot[1], "myLongEntry");
tradeEntryBar = CurrentBar;
}
}
Or.... should I be using OnMarketData, so I would have something like this:
Calculate = calculate.OnBarClose
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
if (marketDataUpdate.MarketDataType == MarketDataType.Ask && marketDataUpdate.Price > PSAR[0] && tradeEntryBar != CurrentBar)
{
EnterLongLimit(0,true,TradeQuantity, PSAR[0], "myLongEntry");
tradeEntryBar = CurrentBar;
}
}
So my question is which of these 3 options (or is there another) is the fastest way of placing my limit order at the PSAR level as soon as it is possible (i.e. on the right side of the market).
Thank you!

Comment