Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I've been lurking on this forum for a few months now, but this is my first post so... Hi!
I'm not a programmer and after a few months of getting frustrated with C#, I decided to switch from NinjaTrader to MC (demo only at this point). I've read most of the Wiki (not very helpful) and have searched but haven't been able to find a clear answer.
Anyway, I'm trying to get my NT strategy coded into MC. I have a bool variable that gets set to true when one indicator reaches a value. Then if that bool is true and my second indicator reaches its value, a sell is triggered.
The problem is that in Ninja, I used the OnOrderExecution method to reset my bool variable to false whenever I entered a trade. But now in MC, my variable is not getting reset and giving me the wrong exits.
So, how exactly do I go about resetting my variable once I enter my position in MC?
Thanks in advance.
Rick
Can you help answer these questions from other members on NexusFi?
Unfortunately that doesn't give the required result. The problem (I think) is that I have multiple entry order conditions and they keep overriding the bool variable during the trade. No matter where I put the "bool = false;" statement, I keep getting the wrong results. I had this same problem with Ninja until I reset the variables in the OnOrderExecution section.
Here is my code, maybe someone can take a look and tell me where I need to put my reset to get the desired result:
By the way, this signal is only for URTY or TNA. It backtested 77% profitable with a .73 Sharpe Ratio (in NinjaTrader) so feel free to try it out.
is this the complete strategy?
it does not look complete.
when you reset your logic, you have to follow the flow, and reset at the specific juncture, and the flow seem something is missing.
For the most part, yes. This the complete strategy. It's meant to be the first half of a pair trade with SRTY (or TZA in the case of TNA). It's a swing trade run on daily bars. Basically, I'm optimizing this half because it is the most profitable. In the end, it will pretty much be "go long SRTY when you're not long URTY."
I have no stop loss or other risk measures because in all tests they have only hurt performance. The only thing left to implement is how to handle the trades during a downtrend as this really the only time I incur my biggest losses.
Forgive my ignorance, I don't quite follow your meaning.
Are saying that I should add more confirmation (i.e. indicators) to my strategy or is there some sort of code that I should be implementing to increase reliability?