performance: Get Strategy Performance

Description Usage Arguments Examples

Description

Gets the performance of an object of class Strategy.

Usage

1
2
3
4
5
6
7
8
9
performance(object, of = "portfolio", type = "performance", from = NULL,
  until = NULL, which = NULL, use.backtest = FALSE,
  include.costs = TRUE)

## S4 method for signature 'Strategy'
performance(object, of = c("portfolio", "assets"),
  type = c("performance", "logReturns", "returns"), from = NULL,
  until = NULL, which = NULL, use.backtest = FALSE,
  include.costs = TRUE)

Arguments

object

An object of class Strategy.

of

Performance to be extracted from assets separately or the portfolio performance.

type

Which type of performance shall be returned. performance is the cumulative performance starting at 1, logReturns to get logarithmic returns or returns for arithmetic returns.

from

The date in character format "yyyy-MM-dd" or as date-object from which performance shall be returned If NULL, no restriction is made.

until

The date in character format "yyyy-MM-dd" or as date-object until which performance shall be returned. If NULL, no restriction is made.

which

Names or number of assets that should be included in performance. If a portfolio performance from only a subset of the assets is calculated, the weights are scaled accordingly.

use.backtest

If TRUE, the signals from the backtesting output are considered for performance calculation. If FALSE, the signals from the initial strategy execution are used.

include.costs

If FALSE, the fixed and relative trading costs are NOT considered for performance calculation. Default value is TRUE. As default values for costs are 0, this argument is obsolete if no costs are given.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run:

# MA(200)-Strategy
params <- list(k=200)
myStrat.MA <- Strategy(assets=assets, strat="MA", strat.params=params)

# Get performance of MA(200)-Strategy
performance(myStrat.MA, from="2015-01-01", until="2015-12-31")

# Get backtest performance of MA(200)-Strategy
# performance(myStrat.MA, from="2015-01-01", until="2015-12-31"
# , use.backtest=TRUE, type="logReturns")

## End(Not run)

Example output

           Portfolio
2015-01-01 1.0000000
2015-01-02 1.0002812
2015-01-03 1.0028657
2015-01-04 1.0033907
2015-01-05 1.0035050
2015-01-06 1.0003639
2015-01-07 0.9987955
2015-01-08 0.9939937
2015-01-09 0.9983060
2015-01-10 0.9983427
2015-01-11 0.9956885
2015-01-12 0.9967398
2015-01-13 0.9966332
2015-01-14 0.9965444
2015-01-15 0.9956075
2015-01-16 0.9939886
2015-01-17 0.9943707
2015-01-18 0.9976131
2015-01-19 0.9982674
2015-01-20 0.9952656
2015-01-21 0.9929763
2015-01-22 0.9940789
2015-01-23 0.9929418
2015-01-24 0.9950245
2015-01-25 0.9919807
2015-01-26 0.9901813
2015-01-27 0.9868609
2015-01-28 0.9862095
2015-01-29 0.9838717
2015-01-30 0.9836338
2015-01-31 0.9821444
2015-02-01 0.9795716
2015-02-02 0.9799849
2015-02-03 0.9802874
2015-02-04 0.9797124
2015-02-05 0.9813297
2015-02-06 0.9873093
2015-02-07 0.9891890
2015-02-08 0.9941164
2015-02-09 0.9967188
2015-02-10 0.9939138
2015-02-11 0.9933137
2015-02-12 0.9938934
2015-02-13 0.9939348
2015-02-14 0.9896594
2015-02-15 0.9897728
2015-02-16 0.9949190
2015-02-17 0.9952948
2015-02-18 0.9947922
2015-02-19 0.9920690
2015-02-20 0.9837841
2015-02-21 0.9861776
2015-02-22 0.9857347
2015-02-23 0.9866246
2015-02-24 0.9868476
2015-02-25 0.9925246
2015-02-26 0.9912349
2015-02-27 0.9942311
2015-02-28 0.9936380
2015-03-01 0.9928955
2015-03-02 0.9937678
2015-03-03 0.9937922
2015-03-04 0.9906467
2015-03-05 0.9887899
2015-03-06 0.9867332
2015-03-07 0.9858396
2015-03-08 0.9798789
2015-03-09 0.9855234
2015-03-10 0.9858348
2015-03-11 0.9831979
2015-03-12 0.9863522
2015-03-13 0.9868200
2015-03-14 0.9831131
2015-03-15 0.9852714
2015-03-16 0.9853108
2015-03-17 0.9839694
2015-03-18 0.9858574
2015-03-19 0.9864559
2015-03-20 0.9826395
2015-03-21 0.9802763
2015-03-22 0.9805885
2015-03-23 0.9782650
2015-03-24 0.9790244
2015-03-25 0.9792316
2015-03-26 0.9819756
2015-03-27 0.9847907
2015-03-28 0.9832663
2015-03-29 0.9820442
2015-03-30 0.9820482
2015-03-31 0.9853740
2015-04-01 0.9852024
2015-04-02 0.9843667
2015-04-03 0.9836882
2015-04-04 0.9858449
2015-04-05 0.9791699
2015-04-06 0.9801293
2015-04-07 0.9820717
2015-04-08 0.9814775
2015-04-09 0.9835571
2015-04-10 0.9804951
2015-04-11 0.9825561
2015-04-12 0.9823463
2015-04-13 0.9842905
2015-04-14 0.9840208
2015-04-15 0.9827555
2015-04-16 0.9832509
2015-04-17 0.9790637
2015-04-18 0.9812720
2015-04-19 0.9795038
2015-04-20 0.9761348
2015-04-21 0.9762367
2015-04-22 0.9763972
2015-04-23 0.9693303
2015-04-24 0.9717407
2015-04-25 0.9708908
2015-04-26 0.9681659
2015-04-27 0.9617540
2015-04-28 0.9635462
2015-04-29 0.9692616
2015-04-30 0.9682552
2015-05-01 0.9642940
2015-05-02 0.9650007
2015-05-03 0.9666500
2015-05-04 0.9700298
2015-05-05 0.9680127
2015-05-06 0.9668812
2015-05-07 0.9701362
2015-05-08 0.9649548
2015-05-09 0.9636810
2015-05-10 0.9624173
2015-05-11 0.9610358
2015-05-12 0.9615367
2015-05-13 0.9584390
2015-05-14 0.9593047
2015-05-15 0.9568593
2015-05-16 0.9582282
2015-05-17 0.9601933
2015-05-18 0.9628760
2015-05-19 0.9637618
2015-05-20 0.9670466
2015-05-21 0.9705906
2015-05-22 0.9746388
2015-05-23 0.9745348
2015-05-24 0.9746871
2015-05-25 0.9692832
2015-05-26 0.9657704
2015-05-27 0.9644059
2015-05-28 0.9661226
2015-05-29 0.9659640
2015-05-30 0.9629735
2015-05-31 0.9636553
2015-06-01 0.9602157
2015-06-02 0.9572621
2015-06-03 0.9538256
2015-06-04 0.9534256
2015-06-05 0.9569912
2015-06-06 0.9580802
2015-06-07 0.9582655
2015-06-08 0.9586307
2015-06-09 0.9561791
2015-06-10 0.9595100
2015-06-11 0.9622820
2015-06-12 0.9604937
2015-06-13 0.9673237
2015-06-14 0.9675515
2015-06-15 0.9661076
2015-06-16 0.9723076
2015-06-17 0.9692909
2015-06-18 0.9634865
2015-06-19 0.9655692
2015-06-20 0.9662743
2015-06-21 0.9633190
2015-06-22 0.9686360
2015-06-23 0.9671115
2015-06-24 0.9651636
2015-06-25 0.9624123
2015-06-26 0.9663776
2015-06-27 0.9671790
2015-06-28 0.9642597
2015-06-29 0.9624224
2015-06-30 0.9614432
2015-07-01 0.9629991
2015-07-02 0.9651607
2015-07-03 0.9660846
2015-07-04 0.9642920
2015-07-05 0.9617527
2015-07-06 0.9593905
2015-07-07 0.9605350
2015-07-08 0.9609401
2015-07-09 0.9587537
2015-07-10 0.9551058
2015-07-11 0.9559316
2015-07-12 0.9575766
2015-07-13 0.9583224
2015-07-14 0.9560299
2015-07-15 0.9556539
2015-07-16 0.9541030
2015-07-17 0.9527747
2015-07-18 0.9523835
2015-07-19 0.9521456
2015-07-20 0.9531279
2015-07-21 0.9520605
2015-07-22 0.9527468
2015-07-23 0.9530640
2015-07-24 0.9528040
2015-07-25 0.9533882
2015-07-26 0.9567004
2015-07-27 0.9568653
2015-07-28 0.9548578
2015-07-29 0.9541642
2015-07-30 0.9537529
2015-07-31 0.9509801
2015-08-01 0.9571523
2015-08-02 0.9572375
2015-08-03 0.9590832
2015-08-04 0.9590313
2015-08-05 0.9643522
2015-08-06 0.9630140
2015-08-07 0.9607823
2015-08-08 0.9593483
2015-08-09 0.9586552
2015-08-10 0.9538458
2015-08-11 0.9507664
2015-08-12 0.9523158
2015-08-13 0.9563637
2015-08-14 0.9554128
2015-08-15 0.9524732
2015-08-16 0.9504426
2015-08-17 0.9498884
2015-08-18 0.9520599
2015-08-19 0.9521031
2015-08-20 0.9513820
2015-08-21 0.9460652
2015-08-22 0.9411852
2015-08-23 0.9389518
2015-08-24 0.9431001
2015-08-25 0.9425068
2015-08-26 0.9383957
2015-08-27 0.9408372
2015-08-28 0.9427304
2015-08-29 0.9429345
2015-08-30 0.9472515
2015-08-31 0.9498758
2015-09-01 0.9478208
2015-09-02 0.9419286
2015-09-03 0.9393665
2015-09-04 0.9369810
2015-09-05 0.9352107
2015-09-06 0.9371507
2015-09-07 0.9398010
2015-09-08 0.9415014
2015-09-09 0.9461475
2015-09-10 0.9487661
2015-09-11 0.9465726
2015-09-12 0.9502683
2015-09-13 0.9486046
2015-09-14 0.9468793
2015-09-15 0.9452703
2015-09-16 0.9472243
2015-09-17 0.9439325
2015-09-18 0.9422907
2015-09-19 0.9430243
2015-09-20 0.9418001
2015-09-21 0.9443803
2015-09-22 0.9468245
2015-09-23 0.9450453
2015-09-24 0.9449539
2015-09-25 0.9450512
2015-09-26 0.9456677
2015-09-27 0.9445245
2015-09-28 0.9487795
2015-09-29 0.9524158
2015-09-30 0.9549528
2015-10-01 0.9521534
2015-10-02 0.9537796
2015-10-03 0.9546642
2015-10-04 0.9586775
2015-10-05 0.9581836
2015-10-06 0.9564972
2015-10-07 0.9536756
2015-10-08 0.9534710
2015-10-09 0.9540509
2015-10-10 0.9544541
2015-10-11 0.9534450
2015-10-12 0.9542755
2015-10-13 0.9536508
2015-10-14 0.9572046
2015-10-15 0.9558512
2015-10-16 0.9537771
2015-10-17 0.9532259
2015-10-18 0.9508326
2015-10-19 0.9481777
2015-10-20 0.9488034
2015-10-21 0.9450796
2015-10-22 0.9418699
2015-10-23 0.9427607
2015-10-24 0.9465634
2015-10-25 0.9494237
2015-10-26 0.9499372
2015-10-27 0.9465987
2015-10-28 0.9495075
2015-10-29 0.9495724
2015-10-30 0.9515330
2015-10-31 0.9507621
2015-11-01 0.9499631
2015-11-02 0.9492349
2015-11-03 0.9504934
2015-11-04 0.9473828
2015-11-05 0.9445205
2015-11-06 0.9446920
2015-11-07 0.9424081
2015-11-08 0.9429418
2015-11-09 0.9431746
2015-11-10 0.9450453
2015-11-11 0.9433024
2015-11-12 0.9446020
2015-11-13 0.9445696
2015-11-14 0.9421350
2015-11-15 0.9410306
2015-11-16 0.9368269
2015-11-17 0.9352450
2015-11-18 0.9315977
2015-11-19 0.9308014
2015-11-20 0.9293143
2015-11-21 0.9305615
2015-11-22 0.9251346
2015-11-23 0.9248882
2015-11-24 0.9259039
2015-11-25 0.9254995
2015-11-26 0.9216782
2015-11-27 0.9206742
2015-11-28 0.9172128
2015-11-29 0.9198726
2015-11-30 0.9208988
2015-12-01 0.9208464
2015-12-02 0.9210385
2015-12-03 0.9210619
2015-12-04 0.9253208
2015-12-05 0.9239907
2015-12-06 0.9244272
2015-12-07 0.9246500
2015-12-08 0.9264835
2015-12-09 0.9238625
2015-12-10 0.9248822
2015-12-11 0.9248391
2015-12-12 0.9247674
2015-12-13 0.9294084
2015-12-14 0.9267485
2015-12-15 0.9248218
2015-12-16 0.9233129
2015-12-17 0.9241368
2015-12-18 0.9245269
2015-12-19 0.9220783
2015-12-20 0.9226478
2015-12-21 0.9211555
2015-12-22 0.9190065
2015-12-23 0.9194690
2015-12-24 0.9197666
2015-12-25 0.9220339
2015-12-26 0.9257872
2015-12-27 0.9266251
2015-12-28 0.9239919
2015-12-29 0.9237405
2015-12-30 0.9251620
2015-12-31 0.9242056

Strategy documentation built on May 2, 2019, 2:09 a.m.