Profile Picture

SystemResults Plugin

Posted By thinkjohn 3 Years Ago
Message
Posted Monday May 19 2014
Hello,
I am trying to develop a SystemResults Plugin that will help me generate a P&L stream to be used in PerTrac.

I have a functioning SystemResults Control that I can debug, I just need help with the object model in terms of where I get the data I need.

Here is a simple algorithm I would like to use for the SystemResults plugin:

Get a list of symbols (done)

Get a list of positions for each symbol (done)


For each trade date (start at FirstTradeDate and end at LastTradeDate)
For Each Symbol
      get the close for this symbol and current trade date (missing)

      from the position list, find out if I am long or short the position on this trade date (done)

      calculate the P&L for this trade date (to do, I need the close for this symbol and date)

export to excel (to do, but I have the code as I have done this before)
   Next

trade date = trade date + 1
Next

How can I get the close by symbol and trade date? I thought this information would be in the FinalSystemResults, I just can't seem to figure out how to get it.

Can someone help?

Posted Tuesday May 20 2014
No Progress.

This code should do something but I can't get the data I need:

Bars = FinalSystemResults.SystemData.SystemBars(Symbol)
LastBarData = Bars.Current
OpenIndex = RightEdge.Common.BarUtils.BarLookBackFromDate(Bars, TradeDateStart)


First line of code returns a list of bars with only 1 item (last bar).
I assign that to LastBarDate like in other examples.

I try to get the OpenIndex via BarUtils and TradeDateStart. OpenIndex is -1.

SystemBars should give me a list.

Do I need to set something in the properties to make sure the BarData exists and can be accessed in the SystemResults Plugin?

Thanks,
John
Posted Friday May 23 2014
Hi John,

The bar/price data is not directly available after the simulation is complete. This is because for large data sets it may not even all fit in memory at once.

"System statistics" are calculated and saved for each bar, and what you want to do sounds similar to those type of calculations. So you may be able to get the information you need via the system statistics.

If that doesn't work, then I think you will need to save the information you need as part of your trading system code. If you want to use it in a system results plugin, you could write the data to a file and store the filename in the SystemData.CustomString field for the system results plugin to pick up.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems