I reviewed the code and had the initial thought that I didn't see the arrows displayed.
The arrows needs to be adjusted as follows (or in a similar manner):
other than that, no immediate comments. I don't use market orders in real-life and don't like the NT manner of EnterLong/Short...
I'm trying to get a strat to work with scaling out but using limit entry orders. I'm stuck temporarily until I figure the nuances of coding the NT limit orders / stop orders.
Thanks Kirk. Yep its a bit buggy. I just deleted a bunch of other stuff in an existing template I use for backtesting and added the Close>Close etc for long/short before posting it. I just tried it on some contracts and its going long only, which my original strat doesn't do.
A better way (if someone wants to step up to the plate) might be random entries (long or short) every x number of bars if marketposition=flat.
I made a few quick changes. I'd like to work on this more but don't have time right now. The random entries have always been an interesting thing for me as an exercise in money management, but I don't have the extra few minutes right now to code it up
I did make these changes:
I also commented out the if Flat part, because if a new condition for a reversal occurs I want to exit the open trade and enter the new direction.
The idea works well in trending periods but obviously fails when market is not trending, which is the majority of time.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The following user says Thank You to Big Mike for this post:
I was testing a commercial auto-trader recently, and it had the similar issue with non-trending market. If I let it run without intervention, all the small profits would erode into big losses due to frequent whipsaws. I am wondering if there is any effective way to tell a non-trendng market.