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

Reply

Bookmark

Sort
Glitch8
 ( 10.62% )
- 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
- ago
#4
Hi,
Yes, this works!
I am wondering the meaning of IsCompleted
in the Transaction object.
Thanks!
0
Cone8
 ( 4.98% )
- ago
#5
IsCompleted is real-only property used internally to enable edits for orders.
0

Reply

Bookmark

Sort