Real Time Data Now / Nest Trader to Amibroker, Fcharts

josh1

Well-Known Member
@LVGandhi

Sorry to see that.
Is the original RTDMan by Tracerbullet working? Do you have it?

Edit - This seems to be happening with Nest Trader only. I understand you are frustrated.
What about others using NSENOW?

In my case, it is working for all scrips and CNX Nifty only. It does not work with other indexes. There is some problem with data received for other indexes before MCX start. Once MCX starts, it is working.

The application is working perfectly with NSENOW at my end.
 
Last edited:
Dear Sir,
So far it is (version 1.30) not working properly in realtime, whereas version 1.25 (it was in my computer so I installed it) works nicely. Although it was feeding NIFTY index data so I opened Settings.ini file of both 1.30 version and 1.25 version, and I have noticed is that the the scrips details of 1.30 are not updated whereas in the case of version 1.25 it looks like
Scrip1=cde_fo|USDINR15OCTFUT;USDINR15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest
Scrip2=nse_cm|TATASTEEL-EQ;TATASTEEL;LTP;LTT;Volume Traded Today;Open Interest
Scrip3=nse_cm|TATAMTRDVR-EQ;TATAMTRDVR;LTP;LTT;Volume Traded Today;Open Interest
Scrip4=nse_cm|TATAMOTORS-EQ;TATAMOTORS;LTP;LTT;Volume Traded Today;Open Interest
Scrip5=nse_fo|TATAMOTORS15OCT380CE;TATAMOTORS15OCT380CE;LTP;LTT;Volume Traded Today;Open Interest
Scrip6=nse_fo|TATAMOTORS15OCT370PE;TATAMOTORS15OCT370PE;LTP;LTT;Volume Traded Today;Open Interest
Scrip7=nse_cm|SHARONBIO-EQ;SHARONBIO;LTP;LTT;Volume Traded Today;Open Interest
Scrip8=nse_cm|SBIN-EQ;SBIN;LTP;LTT;Volume Traded Today;Open Interest
Scrip9=nse_cm|PIONDIST-EQ;PIONDIST;LTP;LTT;Volume Traded Today;Open Interest
Scrip10=nse_cm|NIFTYEES-EQ;NIFTYEES;LTP;LTT;Volume Traded Today;Open Interest
Scrip11=nse_fo|NIFTY15OCTFUT;NIFTY15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest
Scrip12=nse_cm|N100-EQ;N100;LTP;LTT;Volume Traded Today;Open Interest
Scrip13=cde_fo|JPYINR15OCTFUT;JPYINR15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest
Scrip14=nse_cm|JINDALPOLY-EQ;JINDALPOLY;LTP;LTT;Volume Traded Today;Open Interest
Scrip15=nse_cm|INFY-EQ;INFY;LTP;LTT;Volume Traded Today;Open Interest
Scrip16=nse_cm|HDFCBANK-EQ;HDFCBANK;LTP;LTT;Volume Traded Today;Open Interest
Scrip17=cde_fo|GBPINR15OCTFUT;GBPINR15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest

I am using NEST TRADER
 

josh1

Well-Known Member
@Tracerbullet -- Can you help with this?

Unhandled exception at 0x7c812afb in RTDMan.exe: Microsoft C++ exception: std::invalid_argument at memory location 0x0012f82c..

> msvcp100d.dll!std::_Xinvalid_argument(const char * _Message) Line 9 C++
RTDMan.exe!std::stod(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Str, unsigned int * _Idx) Line 646 + 0xd bytes C++
RTDMan.exe!MiscUtil::getDouble(const tagVARIANT & var) Line 51 + 0x3a bytes C++
RTDMan.exe!Worker:: processRTDData(const std::map<long,ATL::CComVariant,std::less<long>,std::allocator<std:: pair<long const ,ATL::CComVariant> > > * data) Line 209 + 0xc bytes C++
RTDMan.exe!Worker:: poll() Line 162 C++
RTDMan.exe!wmain(int argc, wchar_t * * argv) Line 48 C++
RTDMan.exe!__tmainCRTStartup() Line 552 + 0x19 bytes C
RTDMan.exe!wmainCRTStartup() Line 371 C
kernel32.dll!7c817077()


Line 208 and 209 of Worker
Code:
case LTP 			// This is last field received from RTD Server (Enum = 3)
newdata.ltp      = MiscUtil::getDouble( topic_value );
This is MiscUtil::getDouble
Code:
double MiscUtil::getDouble( const VARIANT &var ){
    double output = 0; 

    if( var.vt == VT_I4  ){                    // Long        
        output = (double)var.lVal; 
    }
    else if( var.vt == VT_R8 ){                // Double        
        output = var.dblVal ; 
    }
    else if( var.vt == VT_BSTR ){              // BSTR
 [B]       output = std::stod( getString(var)  );                // Line 51[/B]
    }    
    return  output;
}
I have not tinkered with your COM code.

Is it possible to send raw data to console as it is? I had programmed RTDMan to send data output to console. It seems there is problem converting LTP from string to decimal number.
 
Last edited:

josh1

Well-Known Member
Dear Sir,
So far it is (version 1.30) not working properly in realtime, whereas version 1.25 (it was in my computer so I installed it) works nicely. Although it was feeding NIFTY index data so I opened Settings.ini file of both 1.30 version and 1.25 version, and I have noticed is that the the scrips details of 1.30 are not updated whereas in the case of version 1.25 it looks like
Scrip1=cde_fo|USDINR15OCTFUT;USDINR15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest
Scrip2=nse_cm|TATASTEEL-EQ;TATASTEEL;LTP;LTT;Volume Traded Today;Open Interest
Scrip3=nse_cm|TATAMTRDVR-EQ;TATAMTRDVR;LTP;LTT;Volume Traded Today;Open Interest
Scrip4=nse_cm|TATAMOTORS-EQ;TATAMOTORS;LTP;LTT;Volume Traded Today;Open Interest
Scrip5=nse_fo|TATAMOTORS15OCT380CE;TATAMOTORS15OCT380CE;LTP;LTT;Volume Traded Today;Open Interest
Scrip6=nse_fo|TATAMOTORS15OCT370PE;TATAMOTORS15OCT370PE;LTP;LTT;Volume Traded Today;Open Interest
Scrip7=nse_cm|SHARONBIO-EQ;SHARONBIO;LTP;LTT;Volume Traded Today;Open Interest
Scrip8=nse_cm|SBIN-EQ;SBIN;LTP;LTT;Volume Traded Today;Open Interest
Scrip9=nse_cm|PIONDIST-EQ;PIONDIST;LTP;LTT;Volume Traded Today;Open Interest
Scrip10=nse_cm|NIFTYEES-EQ;NIFTYEES;LTP;LTT;Volume Traded Today;Open Interest
Scrip11=nse_fo|NIFTY15OCTFUT;NIFTY15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest
Scrip12=nse_cm|N100-EQ;N100;LTP;LTT;Volume Traded Today;Open Interest
Scrip13=cde_fo|JPYINR15OCTFUT;JPYINR15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest
Scrip14=nse_cm|JINDALPOLY-EQ;JINDALPOLY;LTP;LTT;Volume Traded Today;Open Interest
Scrip15=nse_cm|INFY-EQ;INFY;LTP;LTT;Volume Traded Today;Open Interest
Scrip16=nse_cm|HDFCBANK-EQ;HDFCBANK;LTP;LTT;Volume Traded Today;Open Interest
Scrip17=cde_fo|GBPINR15OCTFUT;GBPINR15OCTFUT;LTP;LTT;Volume Traded Today;Open Interest

I am using NEST TRADER
Copy this setting.ini to folder where you installed 1.30. Read help file to know how to update settings.ini in 1.30
 

TracerBullet

Well-Known Member
@Tracerbullet -- Can you help with this?

Unhandled exception at 0x7c812afb in RTDMan.exe: Microsoft C++ exception: std::invalid_argument at memory location 0x0012f82c..

> msvcp100d.dll!std::_Xinvalid_argument(const char * _Message) Line 9 C++
RTDMan.exe!std::stod(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Str, unsigned int * _Idx) Line 646 + 0xd bytes C++
RTDMan.exe!MiscUtil::getDouble(const tagVARIANT & var) Line 51 + 0x3a bytes C++
RTDMan.exe!Worker:: processRTDData(const std::map<long,ATL::CComVariant,std::less<long>,std::allocator<std:: pair<long const ,ATL::CComVariant> > > * data) Line 209 + 0xc bytes C++
RTDMan.exe!Worker:: poll() Line 162 C++
RTDMan.exe!wmain(int argc, wchar_t * * argv) Line 48 C++
RTDMan.exe!__tmainCRTStartup() Line 552 + 0x19 bytes C
RTDMan.exe!wmainCRTStartup() Line 371 C
kernel32.dll!7c817077()


Line 208 and 209 of Worker
Code:
case LTP 			// This is last field received from RTD Server (Enum = 3)
newdata.ltp      = MiscUtil::getDouble( topic_value );
This is MiscUtil::getDouble
Code:
double MiscUtil::getDouble( const VARIANT &var ){
    double output = 0; 

    if( var.vt == VT_I4  ){                    // Long        
        output = (double)var.lVal; 
    }
    else if( var.vt == VT_R8 ){                // Double        
        output = var.dblVal ; 
    }
    else if( var.vt == VT_BSTR ){              // BSTR
 [B]       output = std::stod( getString(var)  );                // Line 51[/B]
    }    
    return  output;
}
I have not tinkered with your COM code.

Is it possible to send data to console as it is?
1) Conversion from COM datatype to c++ data type in util is a bit flaky as i have not used try-catch for these functions. So if Nest/NOW does what we expect, it works else crash. It always worked fine, so didnt change it.

Ill write improved versions of these functions and post it later. But we still need to check why ltp is not double.

This case of BSTR to Double conversion happened for index only when i wrote it. Ideally NEST should send it as Double which it does for normal scrips but for indices - it would send LTP as string.

2) You can print the string we get from getString(var) to console.
std::cout << getString(var) << std::endl should probably work.

3) Even better, if you can reproduce this - then debug using VC++ and inspect what data we have in from Nest/NOW. You can check in input variable of processRTDData() - const std::map<long,CComVariant>* data.
Just check the topic_id and topic_value. We detect it as LTP and try to convert String to Double if COM type is BSTR.

If its still unclear then debug RTDClient::readNewData() where we make the actual COM call to RefreshData() and get data back in data_sa.

Basically, we want to see what NEST is sending for LTP. We will have to then maybe ignore the update if LTP string is bad.
Also - If this is failing here - then it should also fail in my last version. Someone please confirm this.
 

josh1

Well-Known Member
Hi TB,

Thanks for the prompt reply. Yes... it failed for MCX indices for your original version before market start. When I removed them from setttings.ini, it worked properly.

First it was ltt. Nest Trader sent empty ltt for all scrips before market start. I took care of that.

Now it is ltp. It seams Nest Trader is sending some garbage in place of ltp which RTDMan is not able to handle.

If you see screenshot sent by LVGandhi, he is having Nest Trader from some other broker called VNS Finance. In his case also connection is happening but RTDMan crashes as it receives data.

Nest Trader is not behaving ideally.
 
Hi Josh sir
I write poor english kindly solve my problem
(1) Any watch list i prepared in excel i.e. CIPLA
(2) When output graf in metastock is CIPLA 0
(3) When i back fill in data downoader scrip name cipla did not match in cipla 0
screen shot is post my above post.
 
After a very frustrating experience last week with RTD 1.30 I tried to make a fresh start on Monday (Oct 19, 2015). But it simply freezed and nothing worked for an hour. I deleted all the files n folders of new RTD and tried the old reliable amibrokerfeeder of Josh and its NestRTD folder. But hell of it... even that crashed again and again. First Two hours wasted on first day of trading. Then I had my epiphany.. a real revelation moment .. I checked task manager.. Amibroker was using 600* MB memory and add 200* mb memory of nest.. Hell.. My amibroker cache was set at 512 MB. The problem had nothing to do with RTD 1.30 or any version per se .. but with Amibroker itself..
I opened amibroker Tools>Preferences>Data and set in-memory cache size to 1020 MB.(maximum is 1024 allowed by my version of amibroker 5.60). I saved the Preferences settings. Closed amibroker. And after that when I opened RTD 1.30 everything worked fine (saving a little hickup.. tabs changed to some other symbold.. like nifty to lupin etc.. which I changed back n saved ). I backfilled and started realtime update .... did the trading with the peace of mind.
I feel it is much better to use latest version of amibroker or at least version 5.90 upward (I wish I have it) as they have provision of bigger cache and better memory uses for complex afl using loops etc.
Thanks a lot for nice Realtime update softy RTD 1.30.
 

Raghuveer

Well-Known Member
If Amibroker is slow/hanging one possible solution:
Tools-Preferences-Data-Default Database settings-In Memory cache size(max symbols): <enter a number higher than the scrips in marketwatch>
Save.
Now do: Tools-Save Preferences.

For example: if number of scrips in marketwatch is 10 enter 11 or more.
 

Similar threads