PDA

View Full Version : Long trade, executing shorts


Dunthrin
07-10-2007, 11:20 AM
I have made a stragedy that only gets into long positions, and works while
it is being back tested, when I go live it enters short trades , and I am not
sure why or on what params it is doing so , do I need to specify not to enter a short? or somthing along those lines?

NinjaTrader_Ray
07-10-2007, 12:23 PM
The strategy will go short when any of the EnterShort() methods are called. I assume you have within your strategy, EnterShort() calls? If you do, I would remove them.

Dunthrin
07-10-2007, 12:28 PM
Thats why I'm confused on why this is happening, the back testing doesn't get into any like it shouldn't , but whern i go live it does I could
post it if you like

Dunthrin
07-10-2007, 12:31 PM
I am using the wizard

NinjaTrader_Ray
07-10-2007, 12:38 PM
In your strategy (using the wizard), do you have actions to EnterShort() ? If yes, please remove them. Then for sure your strategy will not go short.

If you ONLY have EnterLong() methods, then let me know.

Dunthrin
07-10-2007, 12:43 PM
in OnBarUpdate()
I only have EnterLong() and ExitLong() on condition
nothing about shorts

NinjaTrader_Ray
07-10-2007, 12:53 PM
Where do you determine that the strategy is going short?

Thanks.

Dunthrin
07-10-2007, 12:59 PM
In the Control Center under positions, under the tab Side, it says Short
I'm assuming that means its entering a short along with it entering longs in the same column

NinjaTrader_Ray
07-10-2007, 01:33 PM
That is your account position, not your strategy's position.

For example, you can be 5 long in your account, then your strategy runs and is short 1 putting your account at 4 long.

I assume you are trading in Sim101 account? If yes, clear out this account via Tools > Options > Simulator > Reset.

Then the next time you run your strategy, immediately check your "Strategies" tab to see what the current position of the strategy is. If its NOT flat, you can then optionally choose to synchronize your actual account the strategy is trading on with the strategy itself by manually placing a market order in the Control Center Orders tab.

Dunthrin
07-10-2007, 01:50 PM
Yes I'm using the Sim101 acct, I test one stragedy at a time across multi forex markets , optimize on each, I reset between each test
is it possible to get other positions open then the ones from the
stagedies that I'm running? doesn't the stragedy open the positions?

NinjaTrader_Ray
07-10-2007, 02:05 PM
Sure, you could place orders manually.

Dunthrin
07-10-2007, 04:21 PM
How am I ending up in a short position when I'm only executing long trade in my stragedy? if you explained it earlier I'm sorry for the reduntancy

NinjaTrader_Ray
07-10-2007, 04:43 PM
Only you can determine how your account position goes short.

- Clear your Sim101 account
- Ensure your account is flat
- Run your strategy(s)
- Monitor the trades they take, watch the executions tab for fills, watch your account position

This is a debug process to help you understand what is happening.

Dunthrin
07-10-2007, 04:46 PM
thats what I've been doin , is it possible to do a recompile to make sure I have the lastest code? like can I delete the old objects and make new ones to put in the dll?

NinjaTrader_Ray
07-10-2007, 06:04 PM
Sure, just go to Tools > Edit NinjaScript, select your strategy and compile it.

Dunthrin
07-11-2007, 09:49 AM
once I switched machine and reset up everything , I never got into a short trade with , so there is something messed up on other machine
all is working with same stragedy on new machine, dunno what the
diffenerce is , if there is anything ya'll can tell me to check
on why the two machines act different with the same program /stragedy
would be greatly apreciated.
thanks for all your help