Random Entries

This example Strategy uses the Random function to enter Buys and then Sells when Stop or Target rules are met. A different set of Trades will be created for each Test. Random entries can help to optimize other elements of a Strategy besides entries.

The rules are:

  • select stocks from the NASDAQ and NYSE exchanges
  • buy using a dummy criteria of Close Price greater than 0 combined with a random criteria of Random (1 10000) less than or equal to 10
  • close the position using a target if it makes 20% or a stop if it loses more than 5%
  • start with equity of 1,000,000
  • buy 10% of starting equity on each trade regardless of stock price or volatility
  • maintain no more than 10 open positions at a time, with a maximum of 5 new positions on any one day
  • as there will be more buy signals than position slots available, choose stocks in descending order of another Random number
  • exits, entries and stops can occur on any trading day during the test period.

Click 'Apply Changes & Run Test' under the 'Customize Criteria...' panel to adapt to your preferences and run tests.

Customize Criteria and Run Test
Show Criteria for: Buy Sell Short Sell Cover Short
Create a long position when the following criteria is met
Random (1 10000)
Enable and/or logic
1,000,000 10L 10S % Starting Equity
10 Max. Open Positions 5 Max. New Positions in 1 day
Highest Random (1 10000)
Enter at Next Open Exit at Next Open
Stop 5L 5S % exit Stop
Target 15L 15S % exit Stop
None set
60 Days - Latest
All Trading Days
Nasdaq GM Nasdaq GS NYSE
Buy: Close greater than 0 and Random (1 10000) less than or equal to 10
Page size:
Page 1 of 1. Rows 1 to 1 of 1.
4/25/2015 2:12 AMComplete60 Days - Latest10L 10S % Starting EquityHighest Random (1 10000)
Test Number 1Test Time 4/25/2015 2:12 AM
Test Status CompleteTest Period 60 Days - Latest
Starting Equity 1,000,000Position Sizing 10L 10S % Starting Equity
Prioritize Symbols Highest Random (1 10000)Total Profit 73,579.15
Open Profit 38,676.10Return On Equity % 7.36
Annualized Return % 35.17Max Drawdown % -1.93
Sharpe Ratio0.00Number of Closed Trades 9
Percent Profitable 44.44Average Days in Trade 22.67
Winners Profit 59,857.34Losers Profit -24,954.29
Winning / Losing Profit Ratio 2.40Average Winning / Losing Profit Ratio 3.00
Number Of Winners 4Number Of Losers 5
Largest Winner Profit 14,997.17Largest Loser Profit -4,999.64
Average Winners Profit 14,964.34Average Losers Profit -4,990.86
Longest Winner Days 45Longest Loser Days 43
Average Length of Winning Trades 26.25Average Length of Losing Trades 19.80
Most Consecutive Winners 2Most Consecutive Losers 4