Posted By: Zheka
TradeDate does not hold trade entry date - 05/01/20 15:30
The manual states that TradeDate is:
However, this toy code:
produces this output:
TradeDate never contains the time of trade entry, only the time when a trade was actually open.
Quote
The time in Windows Date format when the trade was entered (for pending trades) or opened (for open trades).
However, this toy code:
Code
int checkTradeEntryDate() { print(TO_LOG,"\nTradeEntry=%s", strdate(HMS, (var)TradeDate) ); return 0; } function run() { set(LOGFILE,TICKS); StartDate=2020; BarPeriod=60; MaxLong =1; LifeTime=5; Entry = -5*PIP; if (priceClose(0)>priceClose(1)) enterLong(checkTradeEntryDate); }
produces this output:
Quote
[82: Tue 20-01-07 22:00] (1.11524)
(EUR/USD::L) Long 1@1.11474 Entry limit
(EUR/USD::L) Entry limit 1.11474 hit by 1.11468 at 22:01:00
TradeEntry=NaD
[EUR/USD::L08301] Long 1@1.11480 at 22:01:00
TradeEntry=22:01:00
TradeEntry=22:01:00
(EUR/USD::L) Long 1@1.11474 Entry limit
(EUR/USD::L) Entry limit 1.11474 hit by 1.11468 at 22:01:00
TradeEntry=NaD
[EUR/USD::L08301] Long 1@1.11480 at 22:01:00
TradeEntry=22:01:00
TradeEntry=22:01:00
TradeDate never contains the time of trade entry, only the time when a trade was actually open.