function Session()
clear
clc
global ni_Session price number isRunning isLoading
try
	delete(ni_Session);
catch
end
isRunning = 1;
number=0;
price=[];
disp('Creating NetInvestor session');
ni_Session = actxserver('NiApi.SrvrSession.1');


ni_Session.set('HostAddr', 'nidemo.mfd.ru');
ni_Session.set('HostPort', 2900);
ni_Session.set('Name', 'test');
ni_Session.set('Password', 'test');
ni_Session.set('Journal', 'log.txt');
ni_Session.registerevent({'onlogin', 'onlogin'});
ni_Session.Connect
%while isRunning==1
%end
pause(100);
ni_Session.Disconnect
pause(3);
end
