NexusFi: Find Your Edge


Home Menu

 





Outside the box: Random entries, rules based exits


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one Big Mike with 5 posts (0 thanks)
    2. looks_two wh with 2 posts (0 thanks)
    3. looks_3 sefstrat with 2 posts (1 thanks)
    4. looks_4 MXASJ with 1 posts (0 thanks)
    1. trending_up 10,597 views
    2. thumb_up 6 thanks given
    3. group 6 followers
    1. forum 13 posts
    2. attach_file 0 attachments




 
Search this Thread

Outside the box: Random entries, rules based exits

  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

Another sleepless night, so I wanted to jot down my thoughts before heading back to bed and trying to sleep.

It has often been said that a good trader can be thrust into a position at any random point in the market (any time, any price), and how he exits the trade is what matters most. After all, it only makes sense: the trade's final outcome is determined by where you exit.

With the advent of piersh's genetic optimizer I thought that maybe now is a good time to create this scenario and see what can come of it.

Concept:
- Random entries: Each bar the strategy randomly selects if it should trade (yes/no) and if yes, should that trade be long or short. I think for sake of simplicity, all trades should occur at Market and close of bar. There is to be no extra logic in deciding where to enter -- for instance, no moving averages, no price action logic, etc. The entry is purely randomized except to perhaps limit based on certain hours of the day.

- Money management: The strategy needs to be programmed with some money management. Whether this via an ATM or not, I think it needs to employ at minimum the following: a) daily stop/target goal, b) maximum per trade loss. I think NT cannot backtest when using an ATM, so my vote would be to not use the ATM in the beginning so we can get some backtest results under us first.

- Logic: The strategy will be reacting to entries, trying to turn a random entry into a winner by simply following a set of predetermined rules and money management. The logic could be based on price action, it could be based on moving averages, etc.

Some questions that come to mind:

1. Should the strategy have the ability to close a position immediately after entry? For instance, if the logic says to only take longs if price is above the XX EMA, but the random entry had us taking a short instead, do we close immediately? Do we give it a bar or two and see what happens? This is part of the logic as well as part of the money management.

2. Should the strategy look at more than one time frame? My vote is a resounding yes: it can randomize entries based on a single time frame chart, but the rules/logic and money management should be able to review data from additional time frames to make decisions on when to exit the trade.

I welcome your thoughts on this endeavor.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

I had an idea, close to this, but on a smaller perimeter, only on position sizing.
My idea was a random entry, with only X0 contract, then scale-in/scale-out on specific levels, add Xn contracts after each specific levels (Fibo or MML for ex.), if the initial trade is not going in the right direction.

Manage a position size, how to scale-in/scale-out, anti-martingale and other stuff, ..., is, I think more important than indicators.
It might be interesting to show it !!!

Follow me on Twitter Reply With Quote
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


Cool. What this really is (and perhaps a better thread title would be..) Lessons of Money Management. In other words, if your money management system stinks, this strategy will make it very clear. If you have a good money management system in place, then you should come out ahead -- even with a completely random entry.

In theory.

I'd like to hear from more people then maybe we can program this over the weekend and see where it lands us.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
wh's Avatar
 wh 
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
Posts: 538 since Jun 2009
Thanks Given: 298
Thanks Received: 512

what will help to develop is to create a model ... with entrie or exit methods via uml ...
so we create a model, build, test and implement ...

entrie and exit methods can be simple bool methods, methods call in onbarupdate()

private bool exit1()
{
if (Close[0] < Close[0]) return true;
else return false;
}

Reply With Quote
  #5 (permalink)
 
Peter's Avatar
 Peter 
Brisbane; Australia
 
Experience: Intermediate
Platform: NT
Broker: IB/TDA needing new broker
Trading: Futures, Forex, Stocks
Posts: 97 since Jun 2009
Thanks Given: 91
Thanks Received: 118

Hey Mike,

did you already have a look at this emsRandomTrader.on this NT page
Maybe interesting for code snippets.

1. Get a feel for optimal trade parameters by randomizing some or all of the trade settings.

2. Time of entry: this should be any number from 1 through 380, the minutes of the trading session (minus 10 minutes).

3. To enter a fixed (non-random) value, put in the same number in ‘min’ and ‘max’.

For example, you want the trade to be taken at minute # 200 of the trading session. Each of ‘Time of Daily Entry Max’ and ‘Time of Daily Entry Min’ should be set to 200.

4. To enter a randomized value, type in the range from which you want the random value to be selected.

For example, you want the trade to be taken randomly within the first half hour of the session, type in ‘Time of Daily Entry Max’ = 30, and ‘Time of Daily Entry Min’ = 1.

5. Random long/short trigger. To randomize the long/short decision, select ‘true’ for each of the ‘TradeLong’ and ‘TradeShort’.

6. Note the parameters remain the same throughout one run (i.e., for each push of the ‘backtest’ button), they are not re-generated for each individual trade.

7. ‘One trade in X bars’. Use this only if you want to take a trade less frequently than once per day. Otherwise this should be kept at 0.

Reply With Quote
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


Peter View Post
Hey Mike,

did you already have a look at this emsRandomTrader.on this NT page
Maybe interesting for code snippets.

Thanks Peter, I had not seen that actually. I rarely visit that forum anymore.

I'll keep working on this as the randomized nature of entering the trades is easy, it's the money management that is tough and that is where our focus should be on this project.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #7 (permalink)
 
sefstrat's Avatar
 sefstrat 
Austin, TX
 
Experience: Advanced
Platform: NT/Matlab
Broker: Interactive Brokers
Trading: FX majors
Posts: 285 since Jun 2009
Thanks Given: 20
Thanks Received: 768

I have done this exercise and was able to make it profitable but it required large drawdowns and a money management system which spans over 3000 lines of code.

Gotta love NT's order handling..

Heteroskedacity is important to understand for robust money management ; )

Reply With Quote
  #8 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


sefstrat View Post
I have done this exercise and was able to make it profitable but it required large drawdowns and a money management system which spans over 3000 lines of code.

Gotta love NT's order handling..

Heteroskedacity is important to understand for robust money management ; )

Don't suppose you want to share your code?

Yes the point of this thread is in fact an exercise in money management, that is entirely the objective.

I had to look up Heteroskedacity. I hate math...

This weekend I'll try to put up a basic framework to get us started, but the real work that needs to be done is on the money management side, which is what I hope to take away from this project and apply to my real world trading.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #9 (permalink)
 
wh's Avatar
 wh 
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
Posts: 538 since Jun 2009
Thanks Given: 298
Thanks Received: 512

Autoregressive conditional heteroskedasticity - Wikipedia, the free encyclopedia

Reply With Quote
  #10 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603




My eyes just glossed over and went into the back of my head...

I regained consciousness when I could no longer see all those equations...

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on June 13, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts