- ago
Hi,
I know PlaceTrade returns a Transaction object. What in the Transaction object states a transaction actually has taken place?
0
347
Solved
3 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.94% )
- ago
#1
It cannot know. Just like when you place a trade at the end of the day, you cannot know whether or not it will fill the next day.
1
Best Answer
- ago
#2
Thanks Glitch.

Mike
0
- ago
#3
Well, you're not going to know on the current, PlaceTrade bar if the trade was taken, but you can certainly query the backtester as to whether or not the trade occurred on the following bar.
CODE:
      public override void Execute(BarHistory bars, int idx)       {          if (HasOpenPosition(bars, PositionType.Long))          {             WriteToDebugLog(LastOpenPosition.EntryBar + "=entryBar "                + LastOpenPosition.EntryDateString + "=entryDate");          }       }
0

Reply

Bookmark

Sort