Is it possible to rebalance the position without using cbt .like if I want to rebalance the permanent portfolio every month or every quarter can I do it without doing cbt routine.
Thanks in advance
One possible solution is to close all of your open positions and reopen them as new trades a the end of each rebalancing period. You will incur extra commissions this way, and of course the back test will show more trade entries and exits than you would have actually had in live trading, but this approach will allow you to approximate the results you want without having to write a CBT.
Can you please write the code how to close all open positions
Closing the positions is easy. Here's an example of closing all trades at the end of each month:
isEndOfMonth = TimeFrameExpand(1, inMonthly, expandPoint); Sell = isEndOfMonth;
Your more difficult task will be to figure out which trades to reopen.
What permanent portfolio is just buying stocks index ,cash,gold,long term treasury.i want to rebalance this portfolio every month with equal allocation that is sell all open position and at the same time buy all position equal .can you please point out any this type of code
@bhartesh you will find that on this forum you should make an effort to learn how to use AmiBroker. If you try to code part or all of your idea and post your code appropriately using the code tags, then you are more likely to get some help from other users. There are many examples to help get you started in the Official Knowledge Base, the User Library and on this forum.
If you make no effort and keep asking others to write your codes for you, it is less likely that you will get help.
I will try and write code