- ago
Would it be possible to add the time stamp in the position list when using "use granuar limit / stop Processing" with a smaller granular Scale (even for the NSF Positions)?
3
1,066
Solved
9 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.84% )
- ago
#1
It won’t be possible for the nsf positions because they’re not even displayed there.
0
- ago
#2
and for the NSF in the Signals list (closing positions)
0
- ago
#3
seems to be quite the same as "Display Execution time when Granular is on"
0
- ago
#4
Does GetPositionsAllSymbols contains the information about the time the order was filled in WL, so one can output it through WriteToDebugLog?
0
Cone8
 ( 7.84% )
- ago
#5
Here's an example of methods to output the NSF positions and their granular entry times in the debug window.

CODE:
      using System.Linq;       // List   the   NSF   Positions             public override   void PostExecute(DateTime dt, List<BarHistory> participants)       {          List<string> nsfs =   GetPositionsAllSymbols(true).Where(x =>   x.NSF == true).Where(x => x.EntryDate == dt).Select(y => y.Symbol).ToList();          if (nsfs.Count > 0)          {             WriteToDebugLog(dt.ToShortDateString() + "\tNSFs: " + String.Join(", ", nsfs), false);                   }       } public override void BacktestComplete() {          WriteToDebugLog("Backtester.TransactionLog.Count = " + Backtester.TransactionLog.Count.ToString(), false);          List<Transaction> tns = Backtester.TransactionLog.Where(x => x.IsEntry == true).Where(x => x.NSF == true).ToList();                    WriteToDebugLog("NSF Count = " + tns.Count + ", and here are their granular entry timestamps...", false);          foreach(Transaction   t in tns)          {             t.Bars.Symbol + "\t " + t.GranularWeightBasis.ToString(), false);          }       }
1
Best Answer
- ago
#6
I think in the last line of the Code a
CODE:
WriteToDebugLog(

is missing.

What i see is, that the granular data are empty?
CODE:
... MRC    01.01.0001 00:00:00 WHD    01.01.0001 00:00:00 EOG    01.01.0001 00:00:00 EPM    01.01.0001 00:00:00 HNRG    01.01.0001 00:00:00 PBT    01.01.0001 00:00:00 PBF    01.01.0001 00:00:00 SWN    01.01.0001 00:00:00 USEG    01.01.0001 00:00:00 ZYXI    01.01.0001 00:00:00 DK    01.01.0001 00:00:00 EGY    01.01.0001 00:00:00 SRPT    01.01.0001 00:00:00 HDSN    01.01.0001 00:00:00 PBT    01.01.0001 00:00:00

Obviously I'm doing something wrong.
In the "Historical Providers" list IB is in the first place and minute data are loaded, in the advanced settings Use Granular Limit is checked and Granular Scale 1 Minute is selected.
0
- ago
#7
It works! Thanks a lot!
I double checked the tutorial video. IB was in the first position but not checked.
I update IB separately.
Now I get the data I need (I have only Minute data for the last month).
CODE:
---Sequential Debug Log--- 24.01.2022   NSFs: RCL, CCL 13.06.2022   NSFs: AMD, TSLA Backtester.TransactionLog.Count = 4085 NSF Count = 4, and here are their granular entry timestamps... RCL    01.01.0001 00:00:00 CCL    01.01.0001 00:00:00 TSLA    13.06.2022 10:12:00 AMD    13.06.2022 09:53:00
0
- ago
#8
I still get not the granular information for all NSF, I have selcted:
- Retain NSF Positions
- Use Granular Limit
- Update Granular Data during Backtest
CODE:
HUBG    17.06.2022 12:00:00 SLB    17.06.2022 10:50:00 RGCO    17.06.2022 16:00:00 ARCH    17.06.2022 10:50:00 BTU    17.06.2022 10:50:00 AINC    17.06.2022 14:30:00 *** SOI    17.06.2022 11:30:00 MNRL    17.06.2022 10:40:00 MRC    17.06.2022 16:00:00 LDOS    17.06.2022 12:10:00 CRTX    17.06.2022 16:00:00 MPAA    17.06.2022 14:20:00 MPC    17.06.2022 10:40:00 BH    01.01.0001 00:00:00   // 10 Minute Data available ISDR    17.06.2022 15:10:00 VTNR    17.06.2022 10:50:00 HNRG    17.06.2022 11:00:00 CEIX    17.06.2022 10:50:00 SWN    17.06.2022 10:40:00 SXC    17.06.2022 15:50:00 EDUC    01.01.0001 00:00:00   // 10 Minute Data available EPM    17.06.2022 11:00:00 WHD    17.06.2022 12:10:00 USEG    17.06.2022 13:00:00 UG    17.06.2022 15:30:00 PBA    17.06.2022 10:40:00 PBT    17.06.2022 11:00:00 WNEB    17.06.2022 16:00:00 WLK    17.06.2022 11:00:00 NOG    23.06.2022 14:50:00 ADM    23.06.2022 15:00:00 *** SOI    01.01.0001 00:00:00   // 10 Minute Data available SRPT    01.01.0001 00:00:00 // 10 Minute Data available PW    23.06.2022 15:50:00

0
Cone8
 ( 7.84% )
- ago
#9
Intraday and daily bars are different. If the intraday data doesn't have the price required to create the trade, then it won't find the trade.

For example, daily bars could have a spike that doesn't appear in the intraday data. (Note that data spikes would be a very unlikely occurrence if using Wealth-Data.)
0

Reply

Bookmark

Sort