Click here to Login





                                                   Rebalancing quarterly

  0

0
Rakla03
2016-05-11 06:35:20


Hi,

I am an absolute newbie to c#...

can someone help me and check the following:

I downloaded a money management script called "Equal Weight rebalanced monthly".

As I would like to have a quarterly rebalancing I changed the scripts second line into:

if(Divers.CurrentDate.Month == 1 && Divers.CurrentDate.Day <= 7 && Divers.CurrentDate.DayOfWeek == DayOfWeek.Monday)

The rest of the code stayed unchanged.

Then I made copy and paste of the above 3x times and changed just the number of the month.

I ran a simple trading system and it worked - BUT am I right?

THX for help




QuantShare
2016-05-12 05:02:27

  0

Yes, it is correct.
Or you can add it this way:

bool isCorrectMonth = Divers.CurrentDate.Month == 1 || Divers.CurrentDate.Month == 4 || Divers.CurrentDate.Month == 7 || Divers.CurrentDate.Month == 10;
if(isCorrectMonth && Divers.CurrentDate.Day <= 7 && Divers.CurrentDate.DayOfWeek == DayOfWeek.Monday)



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Simfin Quarterly Balance Sheet Downloader
Custom Trading System Rebalancing
Company Revenues - US Stocks
Federal Reserve Flow of Funds - Balance Sheet Historical Data
Equal Volatility Sizing

How-to Lessons
Difference between the watchlist and the screener tools
How to quickly add a ticker symbol
How to plot two different time frames in the same chart
How to download historical quotes of indices
How to plot the number of stock tweets per day

Related Forum Threads
Long/short portfolio rebalancing
Rebalancing weekly/monthly/quarterly
monthly rebalancing
Fixed position sizing and daily rebalancing
Issue with rebalancing

Blog Posts
QuantShare Trading Software: New Features in the 3.7.0 Version
QuantShare Trading Software: New Features in the 3.4.0 Version
How to create a trading system, screen and composite using earnin...
Fundamental analysis: How to track economic indicators in the For...
4 Links to Download Free Historical Stock Prices Data by Date









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.