SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Mar 25, 2019 2:54 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Thu Jun 15, 2017 2:40 pm 
Offline

Joined: Tue May 02, 2017 12:41 pm
Posts: 17
Hello,

I am in the process of setting up FOREX symbols for Interactive Brokers.

I noticed that after restarting some AltIds which I just created are deleted.

For example I have set
EUR/GBP - CCY EUR, CCY2 GBP, AltId, CCyId GBP, Exchange IDEALPRO, ProviderID 4, AltSymbol EUR. This works

Then I set
EUR/USD - CCY USd, CCY2 USD, Altid, CCYId USD, Exchange IDEALPRO, ProviderID 4, AltSymbol EUR. This work the first time but after restarting OpenQuant the AltId for EUR/USD is missing.

Any thoughts!?


Top
 Profile  
 
PostPosted: Thu Jun 15, 2017 4:54 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 242
If you are using OQ2014 try this:
InstrumentManager.Save(yourInstrument);

I had that too a few times, until I made this in the code.


Top
 Profile  
 
PostPosted: Thu Jun 15, 2017 6:01 pm 
Offline

Joined: Tue May 02, 2017 12:41 pm
Posts: 17
Yes I am using OQ2014, where should I add this line of code, since I am manually creating the instruments?

Are you using a strategy to import instrument properties?


Top
 Profile  
 
PostPosted: Thu Jun 15, 2017 7:20 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 242
Code:
foreach (Instrument i in InstrumentManager.Instruments)
         {
            InstrumentManager.Save(yourInstrument);
         }


this is what you could post into your strategy, after you done the manuelly adjustments, or setup a new strategy just for that.

Yes, I setup symbols via script, like this:
Code:
Instrument i = new Instrument(InstrumentType.Stock,"yourSymbol","my symbol",148);
InstrumentManager.Save(i);


hope this helps...


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 6:41 am 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 242
or this is from one of the help files:
Quote:
Note that you should check that your program properly disposes the framework when your application
exits. This is a must if you want to store data in the local database. Framework.Dispose flushes data on
disk and closes database files. Most likely your data will not be saved or will become corrupted if you
don’t call Framework.Dispose in the end of your program.
sing System;


Code:
using SmartQuant;
namespace OpenQuant
{
    class Program
    {
        static void Main(string[] args)
        {
            Scenario scenario = new MyScenario(Framework.Current);

            scenario.Run();

            Framework.Current.Dispose();
        }
    }
}
 

this means, that if you ammend your data, just run an empty strategy which includes this:
Code:
Framework.Current.Dispose();


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 12:27 pm 
Offline

Joined: Tue May 02, 2017 12:41 pm
Posts: 17
Thanks for your reply and help.

I ran an empty strategy with Framework.Current.Dispose() but the AltId is still not saved after restarting OpenQuant.

Any thoughts or suggestions?

Thanks


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 4:24 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 242
did you also try my previous post?


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 4:56 pm 
Offline

Joined: Tue May 02, 2017 12:41 pm
Posts: 17
I am trying the following code but I am getting an error "an object reference is required for the non-static field, method or property SmartQuant.InstrumentManager.Instruments.get"


using System;

using SmartQuant;

namespace OpenQuant
{
class Program
{
static void Main(string[] args)
{
Scenario scenario = new MyScenario(Framework.Current);

scenario.Run();

foreach (Instrument i in InstrumentManager.Instruments)
{
InstrumentManager.Save("EUR/AUD");
}

Framework.Current.Dispose();
}
}
}


Top
 Profile  
 
PostPosted: Mon Jun 19, 2017 5:31 pm 
Offline

Joined: Tue May 02, 2017 12:41 pm
Posts: 17
Still no luck saving the AltId, not sure what else to try!?


Top
 Profile  
 
PostPosted: Wed Jun 21, 2017 1:41 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 471
Path for AltId will be available on next release soon.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group