Tag Archives: object

Amazing tutorials ! R for Quantitative Finance Tutorial 3 Quantmod TTR XTS Object

Amazing tutorials ! R for Quantitative Finance Tutorial 3 Quantmod TTR XTS Object

HOLY This guy  is doing amazing stuff. Check him out at https://www.youtube.com/user/creeveshft

Join my FREE newsletter to learn more about how we do stuff with Matlab and R

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Solution for FinancialInstrument R package: object ‘.instrument’ not found

Solution for FinancialInstrument R package: object '.instrument' not found

If you get get error message of from FinancialInstrument:

 object '.instrument' not found 

ltportfolio='longtrend' > ltaccount='longtrend' > initPortf(ltportfolio,'GSPC', initDate=initDate) Error in exists(paste("portfolio", name, sep = "."), envir = .blotter,  :  object '.blotter' not found

solution:
Prior to 2012, the .instrument environment was also stored in the .GlobalEnv, but with FinancialInstrument version 0.10.0, it was moved to live in the top level of the package. Therefore, the .instrument environment doesn't get wiped out if the user clears their workspace. But, it appears to be missing unless you know where to look. This should work ls(FinancialInstrument:::.instrument) But, it's not as robust as using ls_instruments()

https://stat.ethz.ch/pipermail/r-sig-finance/2012q2/010169.html

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

C++ Job interview question: Inheritance and object orientation source code example to create class object on heap vs stack

C++ Job interview question: Inheritance and object orientation source code example to create class object on heap vs stack

This may be a stupid example but does show the difference between stack and heap object creation using class object:

#include
using namespace std;

class MyClass {
public:
MyClass(int x) {}
MyClass() {}
};

int main() {

MyClass *myclass = new MyClass[10]; // creates class object on heap
int i;

int j[] = {1,2,3,4,5,6,7,8,9,10};

MyClass mc2[10] = {1,2,3,4,5,6,7,8,9,10}; //creates class object on stack

MyClass* mc[10];
for (int i=0; i < 10; i++) mc[i] = new MyClass(i); //it will call user-defined constructor here. return 0; }

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!