quantproject-developers Mailing List for QuantProject (Page 152)
Brought to you by:
glauco_1
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(103) |
Dec
(67) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(52) |
Feb
(9) |
Mar
(69) |
Apr
(53) |
May
(80) |
Jun
(23) |
Jul
(24) |
Aug
(112) |
Sep
(9) |
Oct
|
Nov
(58) |
Dec
(93) |
| 2005 |
Jan
(90) |
Feb
(93) |
Mar
(61) |
Apr
(56) |
May
(37) |
Jun
(61) |
Jul
(55) |
Aug
(68) |
Sep
(25) |
Oct
(46) |
Nov
(41) |
Dec
(37) |
| 2006 |
Jan
(33) |
Feb
(7) |
Mar
(19) |
Apr
(27) |
May
(73) |
Jun
(49) |
Jul
(83) |
Aug
(66) |
Sep
(45) |
Oct
(16) |
Nov
(15) |
Dec
(7) |
| 2007 |
Jan
(14) |
Feb
(33) |
Mar
|
Apr
(21) |
May
|
Jun
(34) |
Jul
(18) |
Aug
(100) |
Sep
(39) |
Oct
(55) |
Nov
(12) |
Dec
(2) |
| 2008 |
Jan
(120) |
Feb
(133) |
Mar
(129) |
Apr
(104) |
May
(42) |
Jun
(2) |
Jul
(52) |
Aug
(99) |
Sep
(134) |
Oct
|
Nov
(137) |
Dec
(48) |
| 2009 |
Jan
(48) |
Feb
(55) |
Mar
(61) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(51) |
Sep
|
Oct
(7) |
Nov
|
Dec
|
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
(145) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
| 2011 |
Jan
(78) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(88) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gla...@us...> - 2003-10-27 18:27:38
|
Update of /cvsroot/quantproject/QuantProject/b91_QuantProject
In directory sc8-pr-cvs1:/tmp/cvs-serv18784/b91_QuantProject
Modified Files:
b91_QuantProject.csproj
Log Message:
Fixed app.config warning
Index: b91_QuantProject.csproj
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b91_QuantProject/b91_QuantProject.csproj,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** b91_QuantProject.csproj 13 Oct 2003 22:00:24 -0000 1.1.1.1
--- b91_QuantProject.csproj 27 Oct 2003 18:27:14 -0000 1.2
***************
*** 103,110 ****
<Include>
<File
- RelPath = "app.config"
- BuildAction = "None"
- />
- <File
RelPath = "App.ico"
BuildAction = "Content"
--- 103,106 ----
|
|
From: <gla...@us...> - 2003-10-27 18:27:35
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv18784 Modified Files: QuantProject.suo Log Message: Fixed app.config warning Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvs09LPDd and /tmp/cvsqA8cVg differ |
|
From: <gla...@us...> - 2003-10-26 17:44:27
|
Update of /cvsroot/quantproject/QuantProject In directory sc8-pr-cvs1:/tmp/cvs-serv5112 Modified Files: QuantProject.suo Log Message: Added the Funds script Index: QuantProject.suo =================================================================== RCS file: /cvsroot/quantproject/QuantProject/QuantProject.suo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsgIkuZX and /tmp/cvs8OUqFL differ |
|
From: <gla...@us...> - 2003-10-26 17:42:47
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/Funds
In directory sc8-pr-cvs1:/tmp/cvs-serv5112/b7_Scripts/Funds
Added Files:
AsFunds.cs RunFunds.cs TsFunds.cs
Log Message:
Added the Funds script
--- NEW FILE: AsFunds.cs ---
/*
QuantProject - Quantitative Finance Library
AsProfunds.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections;
using QuantProject.ADT;
using QuantProject.Business.Financial.Ordering;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for AsProfunds.
/// </summary>
public class AsFunds : AccountStrategy
{
public AsFunds( Account account ) : base( account )
{
//
// TODO: Add constructor logic here
//
}
public override ArrayList GetOrdersForCurrentVirtualOrder( Order virtualOrder )
{
ArrayList orders = new ArrayList();
switch(virtualOrder.Type)
{
case OrderType.MarketBuy:
if ( !this.account.Portfolio.IsLong( virtualOrder.Instrument ) )
orders.Add( new Order( OrderType.MarketBuy ,
virtualOrder.Instrument ,
virtualOrder.Instrument.GetMaxBuyableQuantity(
this.account.CashAmount +
this.account.Portfolio.GetMarketValue( virtualOrder.ExtendedDateTime ) ,
virtualOrder.ExtendedDateTime ) , virtualOrder.ExtendedDateTime ) );
break;
case OrderType.MarketSell:
if ( this.account.Portfolio.IsLong( virtualOrder.Instrument ) )
orders.Add( new Order( OrderType.MarketSell ,
virtualOrder.Instrument ,
(long) this.account.Portfolio.GetPosition( virtualOrder.Instrument ).Quantity ,
virtualOrder.ExtendedDateTime ) );
break;
default:
break;
}
return orders;
}
}
}
--- NEW FILE: RunFunds.cs ---
/*
QuantProject - Quantitative Finance Library
RunProfunds.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Accounting;
using QuantProject.Business.Financial.Accounting.Reporting;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Financial.Testing;
using QuantProject.Business.Strategies;
using QuantProject.Business.Scripting;
using QuantProject.Presentation.MicrosoftExcel;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for RunProfunds.
/// </summary>
public class RunFunds : Script
{
public RunFunds()
{
//
// TODO: Add constructor logic here
//
}
private void runForSingleTicker( string ticker )
{
//DateTime startDateTime = new DateTime( 2000 , 6 , 23 );
DateTime startDateTime = new DateTime( 2003 , 1 , 1 );
DateTime endDateTime = new DateTime( 2003 , 9 , 26 );
QuoteCache.Add( new Instrument( ticker ) , BarComponent.Open );
QuoteCache.Add( new Instrument( ticker ) , BarComponent.Close );
//QuoteCache.Add( new Instrument( "MSFT" ) , BarComponent.Close );
QuoteCache.SetCache( startDateTime , endDateTime );
TradingSystems tradingSystems = new TradingSystems();
TsFunds tsFunds = new TsFunds();
tsFunds.Ticker = ticker;
tradingSystems.Add( tsFunds );
Tester tester = new Tester(
new TestWindow( startDateTime , endDateTime ) ,
tradingSystems ,
10000 );
tester.Account.AccountStrategy = new AsProfunds( tester.Account );
//tester.Parameters.Add( new Parameter( "SMAdays" , 10 , 10 , 2 ) );
//tester.Optimize();
tester.Test();
//tester.Account.ReportToConsole( endDateTime );
((History)tester.Account.GetProfitNetLossHistory(
new ExtendedDateTime( endDateTime , BarComponent.Close ) ) ).ReportToConsole();
// tester.Account.AccountReport.ReportToExcel( "MSFT" ,
// new ExtendedDateTime( endDateTime , BarComponent.Close ) );
AccountReport accountReport = tester.Account.CreateReport( ticker , 7 ,
new ExtendedDateTime( endDateTime , BarComponent.Close ) );
ExcelManager.Add( accountReport );
ExcelManager.ShowReport();
}
public override void Run()
{
runForSingleTicker( "FSELX" );
}
}
}
--- NEW FILE: TsFunds.cs ---
/*
QuantProject - Quantitative Finance Library
TsProfunds.cs
Copyright (C) 2003
Glauco Siliprandi
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections;
using QuantProject.ADT;
using QuantProject.ADT.Histories;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Financial.Ordering;
using QuantProject.Business.Strategies;
namespace QuantProject.Scripts
{
/// <summary>
/// Summary description for TsProfunds.
/// </summary>
public class TsFunds : TradingSystem
{
public string Ticker;
public TsFunds()
{
//
// TODO: Add constructor logic here
//
}
private History fund;
// private History microsoftCloseHistorySMA;
public override void InitializeData()
{
fund = QuoteCache.GetOpenHistory( Ticker );
// microsoftCloseHistorySMA = microsoftCloseHistory.GetSimpleMovingAverage( (int) parameter.Value );
}
public override Signals GetSignals( ExtendedDateTime extendedDateTime )
{
Signals signals = new Signals();
if ( !fund.IsLastKey( extendedDateTime.DateTime ) &&
( extendedDateTime.BarComponent == BarComponent.Close ) )
{
DateTime previousMarketDay = (DateTime)((History)fund).GetKey(
((History)fund).IndexOfKeyOrPrevious( extendedDateTime.DateTime ) );
DateTime nextMarketDay =
new Instrument( Ticker ).GetNextMarketDay( extendedDateTime.DateTime );
Signal signal = new Signal();
if ( (Single)fund[ nextMarketDay ] > (Single)fund[ previousMarketDay ] )
{
signal.Add( new Order( OrderType.MarketBuy , new Instrument( Ticker ) , 1 ,
new ExtendedDateTime( nextMarketDay , BarComponent.Open ) ) );
signals.Add( signal );
}
if ( (Single)fund[ nextMarketDay ] < (Single)fund[ previousMarketDay ] )
{
signal.Add( new Order( OrderType.MarketSell , new Instrument( Ticker ) , 1 ,
new ExtendedDateTime( nextMarketDay , BarComponent.Open ) ) );
signals.Add( signal );
}
}
return signals;
}
}
}
|