[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Help Needed with mtRandomA() Fuction


  • Date: Thu, 3 Dec 2009 15:45:46 -0800 (PST)
  • From: B S <bs2167@xxxxxxxxx>
  • Subject: [amibroker] Help Needed with mtRandomA() Fuction

PureBytes Links

Trading Reference Links



Hi- 
 
I am trying to put together a script which will generate random trades and adhere to the following rules:
 
1.  It must exactly generate a predetermined # of trades per symbol in the time period being tested 
 
2.  Of the trades generated, it must adhere to a predetermined subset of # of days in each in trade (e.g. if the designated total # of trades that should be generated per symbol in the period = 10 as per step 1, i'd like to be able to constrain that 3 of the 10 trades are held for 2 days, 5 of the 10 are held for 4 days, and 2 of the 10 are held for 1 day)
 
To address the first point, my initial pass at this was to generate entry signals when the PercentRank of the current bar's random value (as compared to all the random values in the array) was less than (# of desired trades) / (# of bars in periods).  This was close but does not consistently deliver the exact # of desired trades.  Without that working, I haven't attempted to get part 2 right yet. 
 
Would appreciate it if anyone has suggestions on how to go about accomplishing either part of this.  Thanks in advance. 
 
-B



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___