Profile Picture

Replacing a watchlist programmatically?

Posted By willy 5 Years Ago
Message
Posted Monday April 16 2012
Hi,

how can I programmatically replace the watchlist I have selected via the GUI with my own symbols list filtered within MySystem class?

1.   I selected symbols or a whole watchlist or several watch lists from the watchlist folder shown in the RE GUI.
2.   The symbols list will be filtered in the MySystem class and creates a new symbol result list.
3.   How can I replace the original symbols list from step 1 with my filtered symbol result list from step 2?
4. Then the SymbolScript class of only those symbols of the filtered symbol list should be called!


There is one more question. In my watchlist folder I created some subfolders like "S&P500", "DOW" etc., is it possible to get access to the information in my trading system. I mean to see what portfolios are selected? Or will all selected symbols be collected in one list, the symbols list?

I also like to get access to the bar data information of each selected symbol from the MySystem class, I like to check the date/time of the last bar of each symbol. Is that possible? Why I want to do that is the following. Let's assume I fetched the bar data for all symbols in my watchlist folder last Friday and didn't update the information today. Then I would like to make a check in my MySystem class if the data is up to date. I will run my trading system every morning before the stock exchange has opened, so the date/time of the last bar data must be the date of the week day before today.

Example:
Today is Tuesday 17th of April 2012 then the bars last date/time should be Monday 16th of April 2012!
Today is Monday 16th of April 2012 then the bars last date/time should be Friday 13th of April 2012!
and so on.

Is there a way to get this information in the MySystem class?

willy

Edited: Tuesday April 17 2012 by willy
Posted Thursday April 19 2012
You can't modify a watchlist from within a trading system.

You can use an optimization plugin to control which symbols are used for your system (without actually modifying the watchlist). Or, you can write a program outside of RightEdge that modifies the watchlist. This post describes how.

The trading system doesn't have any way to know which folders you have selected in the watch list, it just gets a flat list of symbols. You could use the exchange or one of the custom plugin data fields (on the last tab of the symbol setup dialog) to store that kind of information, and the system could read it.

You can't get the date of the last bar when your system is starting up. You can override the Shutdown method in your MySystem class, so when the system is finished running you can check to see if the last bar it processed is for the correct date.

Thanks,
Daniel
Posted Thursday April 19 2012
Just to make sure, you cannot add any bar data to a symbol in the trading system? (on the go, in NewBar())?
Posted Friday April 20 2012
No, adding more data from the trading system itself isn't supported.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems