Profile Picture

NewBar calls completed for multiple symbols

Posted By steveo311 8 Years Ago
Message
Posted Wednesday February 25 2009
I would like to perform some processing on each bar after all calls to NewBar have finished for all symbols. Does RE provide a mechanism for that?

Thanks, Steve

Posted Wednesday February 25 2009
You can do this by overriding the NewBar method of your system class and putting your processing after you call the base version of the NewBar method:

 

public class MySystem : MySystemBase

{

      public override void Startup()

      {

            // Perform initialization or set system wide options here

 

      }

     

      public override void NewBar()

      {    

            //    Add your code here which should execute before any of the symbol script NewBar methods

           

            //    Call the base implementation, which will call NewBar for all the symbol scripts

            base.NewBar();

           

            //    Add your code here which should execute after all of the symbol script NewBar methods

      }

     

      public override void Shutdown()

      {

      }

}

Thanks,
Daniel

Posted Thursday February 26 2009
Thanks Daniel. That's actually pretty obivous now that I look at the object model again so thanks for bearing with me. I had the OpenQuant model in my head still so I was predisposed to missinterpreting it.
Posted Saturday May 23 2009
Hi,

Are you talking about the MySystemBase class in the file BaseClasses.cs ? If so, I'm unable to modify this file, it's locked. At the top of the file I can read "//This is an auto-generated file. You should not need to edit it."

Thanks
Posted Saturday May 23 2009
FlipFlop (5/23/2009)
Hi,

Are you talking about the MySystemBase class in the file BaseClasses.cs ? If so, I'm unable to modify this file, it's locked. At the top of the file I can read "//This is an auto-generated file. You should not need to edit it."

Thanks


dplaisted (2/25/2009)
public class MySystem : MySystemBase

{



The 'MySystem' class is derived from the MySystemBase in BaseClasses.cs. 'MySystem' is in your trading system source file.

Cheers,
Mark
Posted Sunday May 24 2009
The MySystem class is in a collapsed #region statement by default. Click on the plus on the left side of it to view or edit it.
Posted Monday May 25 2009
Yes, but this is "locked", write protected, I can not write anything in it. How do I unlock it ?

dplaisted (5/24/2009)
The MySystem class is in a collapsed #region statement by default. Click on the plus on the left side of it to view or edit it.
Posted Tuesday May 26 2009
MySystem is not locked, it's in the trading system file (NOT baseclasses.cs). You should be able to expand it (it's in a region at the top of the file, by default). You didn't remove it, did you?

FlipFlop (5/25/2009)
Yes, but this is "locked", write protected, I can not write anything in it. How do I unlock it ?

dplaisted (5/24/2009)
The MySystem class is in a collapsed #region statement by default. Click on the plus on the left side of it to view or edit it.
Posted Monday May 31 2010
Hi, i´m working on a pair trading trading system, so i set up a "Pair Class" and i need to feed the pairs , so i was needing a way to add all symbol bars for that moment. I tried this way and didn´t work it called all bars in one symbol at time.

I needed all symbols for each time elapsed.

                                 Thank´s Vitor Dantas

Posted Tuesday June 01 2010
That's how it's designed to work. Each symbol will get a new bar. You'd have to devise a way to circumvent this behavior.

vitor dantas (5/31/2010)
Hi, i´m working on a pair trading trading system, so i set up a "Pair Class" and i need to feed the pairs , so i was needing a way to add all symbol bars for that moment. I tried this way and didn´t work it called all bars in one symbol at time.

I needed all symbols for each time elapsed.

Thank´s Vitor Dantas


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems