在测试中,K线显示买卖箭头时经常有多个买箭头,一个卖箭头,我怎么能知道当前我已买了,在没卖之前,就不再买了呢,在wealth-lab中都有函数,不知amibroke中有没有,是什么?请知道的朋友帮忙解答一下
Buy = Cross( MA( Close, 10 ), MA( Close, 35 ) ); Sell = Cross( MA( Close, 20 ), MA( Close, 15 ) ); 以上述例子 当你 scan 时会跑出很多箭头 重复很多 sell 跟 buy 但当你 scan 完 Back-Test 後 你可以 Report 出来看 重复的箭头是应该不会被计算的 以上请参考 AmiBroker 初学者上
_SECTION_BEGIN("New formula"); Title = Name() + " "+WriteVal( DateTime(), formatDateTime)+" Close="+C; Plot( C, "Close",1,4); Plot( MA( C, 10 ), "MA( C 10 )",25,1); /*Orange*/ Plot( MA( C, 35 ), "MA( C 35 )",32,1); /*Red*/ Plot( MA( C, 20 ), "MA( C 20 )",43,1); /*BrightGreen*/ Plot( MA( C, 15 ), "MA( C 15 )",29,1); /*Blue*/ Buy = Cross( MA( Close, 10 ), MA( Close, 35 ) ); Sell = Cross( MA( Close, 20 ), MA( Close, 15 ) ); TrendUp=ExRem(Buy,Sell); TrendDn=ExRem(Sell,Buy); PlotShapes( TrendUp * shapeUpArrow ,colorRed,0, MA( Close, 10 ) , 0); PlotShapes( TrendDn * shapeDownArrow ,colorBlue,0, MA( Close, 10 ) , 0); _SECTION_END(); 以上述例子 ExRem() 函数会消除重复买(或卖)的箭头 请参考