|
本帖最後由 joshsmi 於 13-5-22 00:34 編輯
Here it is
Use it in exploration!
- CCI0 = CCI(20);
- Buy = Cross( CCI0, 100 );
- Sell = Cross( 100, CCI0 );
- Short = Cross( -100, CCI0 );
- Cover = Cross( CCI0, -100 );
- BuyPrice = SellPrice = ShortPrice = CoverPrice = O;
- SetTradeDelays( 1, 1, 1, 1 ); // i.e. set to 1 if entering on next bar's open, set to 0 if entering on same bar's close.
- SetBacktestMode( backtestRegular );
- SetOption( "InitialEquity", 100000 );
- SetOption( "FuturesMode" , False );//False for Shares, True for FX or for Futures
- SetOption( "UsePrevBarEquityForPosSizing", True );// Set to False to use current equity for Pos Sizing
- SetOption( "ActivateStopsImmediately", False );
- SetOption( "Allowsamebarexit", False );
- SetOption( "PriceBoundChecking", True );
- SetOption( "AllowPositionShrinking", True );//in case there is not enough cash
- SetOption( "MaxOpenPositions", 1 );
- SetPositionSize( 25, spsPercentOfEquity );
- eq = Equity( 2 ); //1 -> tradedelays == 0, use flag 2 if tradedelays != 0. But this flag setting should be used carefully, read manual
- Filter = 1;
- AddColumn( ValueWhen(Sell || Cover, Eq), "Equity", 1.2, 47, 23, 70 );
複製代碼 |
|