![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Junior Member
Join Date: Feb 2010
Posts: 14
Thanks: 0
Thanked 0 times in 0 posts
|
Would someone be able to suggest to me why my stop orders are not being placed when I execute a long position please? The stop orders are working fine when a short position is executed and the code - as far as i can see - is identical.
entryOrderL/entryOrderS are the IO entry order tags for Long and Short positions respectivel stopOrderL/stopOrderS are the protective stop orders for long and short position respectively StopLevelL/StopLevelS are doubles that store specific price levels to enter the protective stop order and are stored when the entry signal is triggered. Any suggestions would be much appreciated. Mark Quote:
|
|
|
|
|
|
|
#2 |
|
Senior Member
|
Check your code where you set StoplevelL.
|
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Feb 2010
Posts: 14
Thanks: 0
Thanked 0 times in 0 posts
|
Hi
Thanks. I had checked and it seems fine. Quote:
|
|
|
|
|
|
|
#4 |
|
Senior Member
|
Sounds like your short is cancelling your long.
|
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
MJUK05, please set TraceOrders = true in the Initialize() section to see why orders are not being sent or are being canceled.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Member
Join Date: May 2009
Posts: 60
Thanks: 0
Thanked 0 times in 0 posts
|
Hello ninja trader austin i was wondering if you could take a look at my wont compile thread to tell me what I am doing wrong? many thanks James
|
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
James, I am currently wading my way through all the support tickets. Since yours is the most recent, I will get there last. We look at all threads, so asking us to look at your thread isn't necessary.
EDIT: I now see you have multiple tickets open. I'll answer them as I get to them.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Member
Join Date: May 2009
Posts: 60
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the reply Austin,
I am new to this area so I am keen to learn! Speak to you soon!James |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Feb 2010
Posts: 14
Thanks: 0
Thanked 0 times in 0 posts
|
I don't think so. I did not post it as it appears in the strategy. I just cut both snippets of code. They both have different IF entry criteria i.e. entryOrder(short or long) != null so should be working at different times. Austin - thanks i'll give it a go. Cheers Mark |
|
|
|
|
|
#10 |
|
Senior Member
|
In one place you use lower case to label the signal (i.e. "long entry"):
Code:
stopOrderL = ExitLongStop(0, true, 1, StoplevelL, "stop", "long entry"); In the other, you use upper case (i.e. "Long entry"): Code:
entryOrderL = EnterLongStop(0, true, 1, High[0] + 5 * TickSize, "Long entry"); |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Dec 2009
Posts: 102
Thanks: 4
Thanked 0 times in 0 posts
|
Anothertrader
Thanks - good spot. Now the shorts don't trigger but the longs are working as they should. On to solving the next problem! Cheers Mark |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Chart Trading with Buy Stop/ Sell Stop orders | tschalli27 | Charting | 3 | 10-20-2009 03:35 PM |
| Strategy: Using OnOrderUpdate() and OnExecution() methods to submit protective orders | NinjaTrader_Josh | Reference Samples | 0 | 05-08-2008 01:42 AM |
| Order Entry Property: Use stop market for stop loss orders | higler | SuperDOM and other Order Entry Windows | 7 | 07-02-2007 09:06 AM |
| Stop Loss Orders activated by number of trades past stop level | DoveforUsAll | Suggestions And Feedback | 1 | 02-08-2006 01:19 AM |
| Targets - Stop Orders or Stop Limit Orders? | Nereus | ATM Strategies (Discretionary Trading) | 3 | 05-31-2005 07:13 AM |