Ernie - The conditions you have set for BUY and SELL, will determine which equities meet the buy/sell rules; plus if there is more than one stock meeting the Buy/Sell criteria, position score will be used to differentiate the next trade. A way of adding preference as the paragraph says below. Also as Tomasz says below, try this sample code with "detailed log" turned on in the Settings/Report tab and watch the process. Score is reported for each open position as well as the score on entry.
HTH, Joe USING POSITION SCORE You can use new PositionScore variable to decide which trades should be entered if there are more entry signals on different securities than maximum allowable number of open positions or available funds. In such case AmiBroker will use the absolute value of PositionScore variable to decide which trades are preferred. See the code below. It implements simple MA crossover system, but with additional flavour of preferring entering trades on symbols that have low RSI value. If more buy signals occur than available cash/max. positions then the stock with lower RSI will be preferred. You can watch selection process if you backtest with "Detailed log" report mode turned on. ----- Original Message ----- From: "Ernie Newman" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Tuesday, August 29, 2006 12:11 AM Subject: [amibroker] Help with PositionScore >I am writing a trading system to Buy and Sell stocks on the NDX 100. If > the system has multiple buy signals I would like to buy the highest > rank stock which in this case would be the lowest RSI value. > So do I simply put the following line in my script > PositionScore = 100-RSI(); > Will the system automatically buy the issue with the lowest RSI value > for back testing. Can I be assured of this??? > Following is what I am doing. My problem seems to be when I back test a > few days later the Open long position chances to a different stock. > > PositionScore = 100-RSI(); > PosQty = 1; > SetOption("MaxOpenPositions", PosQty); > PositionSize = -100/PosQty; > SetTradeDelays(1,2,1,2); > Buy = CondA AND CondC AND C < 40 AND C > 10 AND CondI > 1; > Sell = CondB; > > THANKS Ernie > > > > > > Please note that this group is for discussion between users only. > > To get support from AmiBroker please send an e-mail directly to > SUPPORT {at} amibroker.com > > For other support material please check also: > http://www.amibroker.com/support.html > > > Yahoo! Groups Links > > > > > > > > Please note that this group is for discussion between users only. To get support from AmiBroker please send an e-mail directly to SUPPORT {at} amibroker.com For other support material please check also: http://www.amibroker.com/support.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/amibroker/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
