Strategy compiling correctly, however no trades are placed. This class is not executing or placing any orders. What is the problem here ?
Thanks!
CODE:
public override void Execute(BarHistory bars, int idx) { Position foundPosition0 = FindOpenPosition(0); if (isShortEntrySignal(bars, idx) && !isShort(LastOpenPosition)) { squarePosition(LastOpenPosition, bars, idx); _transaction1 = PlaceTrade(bars, TransactionType.Short, OrderType.Limit, bars.Close[idx], "Short-Sell Limit"); _transaction1.AutoProfitTargetPrice = foundPosition0.EntryPrice - 0.02; _transaction1 = PlaceTrade(bars, TransactionType.Cover, OrderType.Limit, foundPosition0.EntryPrice - 0.02, "Cover Limit"); }
Thanks!
Rename
Not enough code. There are undefined methods (from our perspective). We can't tell what's wrong with your code if you don't show it.
But the obvious reason is that the "if" statement is always false. Why? Can't tell.
But the obvious reason is that the "if" statement is always false. Why? Can't tell.
Your Response
Post
Edit Post
Login is required