Profile Picture

Live System - CSI continous contracts - onNewBar

Posted By foon33 8 Years Ago
Message
Posted Wednesday October 07 2009
Hi,

I created a future and I uploaded daily historical data from CSI as a continuous contract through an ASCII file.
Then I run my system live with my IB paper trading account.
To simulate a new daily bar, I added data through the bar data editor and I saved.
To my surprise, it did not trigger a newbar event. Why?
When I update my data with a new ASCII file tomorow, will it trigger the newbar event?
Thank you for your help.
Posted Wednesday October 07 2009
Bars are loaded into the system. You cannot start the system, load the bar editor, create a fake bar and expect the system to see it.

What I would recommend in this situation is overriding NewTick. Then you can make decisions at the tick level. You could also setup a multiple frequency system, one for daily and one for x number of minutes, hours, ticks, etc.

foon33 (10/7/2009)
Hi,

I created a future and I uploaded daily historical data from CSI as a continuous contract through an ASCII file.
Then I run my system live with my IB paper trading account.
To simulate a new daily bar, I added data through the bar data editor and I saved.
To my surprise, it did not trigger a newbar event. Why?
When I update my data with a new ASCII file tomorow, will it trigger the newbar event?
Thank you for your help.
Posted Wednesday October 07 2009
Thank you for the answer but I'm not sure to understand it.
Do you mean that when the system is live the newbar event is never called?
I want to work at a daily level, I don't need tick data. I'd like to update my data once a day from CSI, and have the system generate my orders to IB once a newbar is generated. As it does with the backtesting.
Posted Wednesday October 07 2009
NewBar is called for live systems, but it is based on the live data (ticks) coming in, and only when a tick is sent in the time period for the next bar. This means for daily bars, NewBar would only be called when the first tick after midnight was received.

One way to work with daily bars is to update your bar data after the end of the trading day, and run a historical simulation. Then look at the scan tab for orders that were submitted based on the last bar, and open positions based on that. This isn't a perfect solution but it might work for you.

You could also modify your system as Bill suggested to submit orders after a certain time even though NewBar hadn't been called. You could put the logic for this in NewTick or in a NewBar method for higher frequency bars.

You could also write a custom frequency plugin which would create daily bars but would send a new bar before midnight. If you would like to try this route let us know and I can provide some more guidance.

Thanks,
Daniel
Posted Thursday October 08 2009
Thank you Daniel and Bill, I start to understand the logic.
Daniel, your solution of adding a new bar, running simulation and look at the scan would work but it involves manual intervention to open the positions.

I think my main issue is that I don't have live data and hence no event will be called (wether newbar or newtick).
The reason I proceed this way is that I want my system to generate signals based on conitnuous contracts. I'm sure this is the case for many of us. I create a contract in the watchlist that reflects a real contract in IB so I can send orders. But I fill the data of that contract as if it was a continuous contract with data from CSI. However I don't have the skills to write a plugin with CSI. So I want to update my data with ASCII file everyday and while my system is live. Will such update be considered as live data and generate events? By the way, I had to choose "none" as my live data service otherwise IB would have sent the data and I don't want that.

I'm certainly trying to do it the wrong way. So any advice on a proper way is welcome. The question really is how to trade futures based on signals generated with continuous data?
Thank you very much.

Edited: Thursday October 08 2009 by foon33
Posted Thursday October 08 2009
OK, please clarify something in your process for me, how can you make trading decisions on a live system without data coming in? Do you make the decision at some point during the day? The reason I ask is that we do have discretionary trading features and if something suggests that you make a trade, you could always open it manually.

However, if you have to make a calculation on incoming data, in addition to Daniel's frequency plugin suggestion, I would suggest a custom real time data provider plugin. Only this data provider simply reads from a file or other storage, and when you update the file with new price data, the plugin picks it up and sends it to RightEdge as a new bar.

foon33 (10/8/2009)
Thank you Daniel and Bill, I start to understand the logic.
Daniel, your solution of adding a new bar, running simulation and look at the scan would work but it involves manual intervention to open the positions.

I think my main issue is that I don't have live data and hence no event will be called (wether newbar or newtick).
The reason I proceed this way is that I want my system to generate signals based on conitnuous contracts. I'm sure this is the case for many of us. I create a contract in the watchlist that reflects a real contract in IB so I can send orders. But I fill the data of that contract as if it was a continuous contract with data from CSI. However I don't have the skills to write a plugin with CSI. So I want to update my data with ASCII file everyday and while my system is live. Will such update be considered as live data and generate events? By the way, I had to choose "none" as my live data service otherwise IB would have sent the data and I don't want that.

I'm certainly trying to do it the wrong way. So any advice on a proper way is welcome. The question really is how to trade futures based on signals generated with continuous data?
Thank you very much.
Posted Wednesday October 14 2009
Hi,

I'm an EOD trader and only use daily data to make trading decisions.
However I don't want to enter my orders manually because:
- there can be many
- I don't want to make mystakes while entering the orders.

So I want my system to run each evening with a new bar, to generate my orders (open/close a position, define/modify stop loss etc) and to send them automatically to IB.
I don't want my new daily bar to come from IB but from my ASCII file generated by CSI.

So to sum up my questions:
1) Since you explained me newBar is only called when new LIVE data arived, which event can I use (and how) to generate my signals after I update my daily bar?
2) How can I automatically import data from my ASCII files knowing that:
- I don't have the skills to write a plugin to do so
- Each time I import files, it re-import all the data instead of importing just the new day

Thank you for your support.

Posted Wednesday October 14 2009
Without programming skills, it's not possible to automate much of what you're saying. The design of the software is to run in live or simulation, not really straddle between the two as you're describing. In order to do that, you'd have to provide some of the glue in the way of code. Others might have ideas, but nothing comes to my mind, I'm afraid. Ermm

foon33 (10/14/2009)
Hi,

I'm an EOD trader and only use daily data to make trading decisions.
However I don't want to enter my orders manually because:
- there can be many
- I don't want to make mystakes while entering the orders.

So I want my system to run each evening with a new bar, to generate my orders (open/close a position, define/modify stop loss etc) and to send them automatically to IB.
I don't want my new daily bar to come from IB but from my ASCII file generated by CSI.

So to sum up my questions:
1) Since you explained me newBar is only called when new LIVE data arived, which event can I use (and how) to generate my signals after I update my daily bar?
2) How can I automatically import data from my ASCII files knowing that:
- I don't have the skills to write a plugin to do so
- Each time I import files, it re-import all the data instead of importing just the new day

Thank you for your support.

phg
Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)Supreme Being (44,945 reputation)
Posted Wednesday October 14 2009
Just for the heck of it, let me take a pass at this:
1. Import the EOD bar each night into RE.
2. Run an RE strategy in simulation mode to generate signals. This leverages RE indicator capabilities.
3. Copy any signals generated on the last bar into an ordinary flat file.
4. In the morning have a different strategy read the flat file and submit orders to IB when the market opens. This leverages RE order management capabilities.
5. (This second strategy could also be coded to dynamically exit positions using real-time bars intraday.)

Does this seem to get at what you want to do?

-Pete

See also Yahoo group about applying RE.



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems