- ago
Strategy compiling correctly, however no trades are placed. This class is not executing or placing any orders. What is the problem here ?

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!
0
639
1 Replies

Reply

Bookmark

Sort
Cone8
 ( 6.32% )
- ago
#1
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.
0

Reply

Bookmark

Sort