Need help with ninjatrader

I spent my entire weekend on this and I'm ready to just bash my head into the wall and give up.

I have a strategy that looks to place buy and sell orders simultaneously using tick data.

This has proven to be extremely difficult, I need some advice from someone who can help me sort through this.

TLDR – should I be using playback or backtesting? And should I be using managed or unmanaged order types? and is there a difference in the results?

Long version-

Initially I created a strategy that seemed to do exactly what I wanted, and it was profitable enough for me to pursue it further. That is using EnterLongLimit() and EnterShortLimit() inside OnMarketData(). I am using playback from thursday and friday's session, and it doesn't matter what interval I use for the data, I have used 1 minute or 1 tick, it doesn't matter because I'm using OnMarketData to place my orders. At this point I don't know if I should be using a multiple timeframe strategy and a completely different way altogether, but I keep going down this road.

I'm also not sure there is a way to do this using backtesting but I continue down the route of playback, and I export my executions into excel to get some data. I find that a couple trades are blowing up half of my returns, so I decide the next step is to build in a stop loss. That is where everything starts going to hell.

For my life I can't get SetStopLoss() to work. I tried it in every part of the code and it wouldn't work. I decided this is maybe because it needs to run through the full minute bar to work, but it doesn't work on 1 tick interval either. I changed this to ExitLongMIT() and ExitShortMIT(),or ExitLongStopMarket() and ExitShortStopMarket(), nothing has the desired result…as they cancel the other simultaneous orders! Bahh….

SO then I set out to use unmanaged orders. First of all, I had an error that SubmitOrderUmanaged can't be used in a managed strategy. This error wasted 2 hours last night until I gave up. Today I realized that the program needed to be rebooted….epic wtf…working now.

Now the thing is that using unmanaged orders, I spent a couple hours getting it to perfectly replicate the prior strategy, and it can't. It's just different. the fills are completely different. And they aren't profitable at all. So now I am just totally confused and questioning life.

Any help?

Submitted November 08, 2020 at 09:34AM by stilloriginal

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s