Vigilant asset allocation

Hello everyone
I have read vaa paper and its excellent detail backtest on trenxplorer blog.the owner is very generous to provide complete code of the vaa strategy.The main concept is to have risky assets and non risky assets and when anyone of the risky asset show negative momentum then switch to the non risky asset .trendxplorer owner has given the complete code but I thought to implement the strategy with simple rotational system. But it is not working can anybody help me in this regard the code I have written is this
The safe asset portion is in watchlist bond and risky assets and safe asset both are in group 1

BuyPrice = Close;
TimeFrameSet( inMonthly);
SetBacktestMode( backtestRotational );
EnableRotationalTrading() ;
SetOption( "MaxOpenPositions", 1);
SetOption( "Worstrankheld", 1 );
SetPositionSize( 100, method = spsPercentOfEquity );

Thanks in advance

I'm looking the code and i think you are duplicating the code "PositionScore", so may be that is the reason.

You can request it to the author:

I think that the first line assigns a value to PositionScore, and the second one updates the calculated value adding 1000 units :wink: ...

@bhartesh (although being old post of last year and seemingly not having been here since)

First read the forum rules!

As for the code... it is rubbish. That's why it does not work.

Read about proper use of TimeFrame functionality as well as
Why TimeFrameExpand is essential (Warning 509)
Why is it so difficult for you guys to follow software documentation??

Next you set rotational mode two times. Why? Just use SetBacktestMode( backtestRotational ); at top and that's it.

And SetOptions belong to top. It makes no sense to mix them with other code.


1 Like