StopLoss Order Placed on Opposite of Entry Order - NinjaTrader Programming | futures io social day trading
futures io futures trading


StopLoss Order Placed on Opposite of Entry Order
Updated: Views / Replies:209 / 5
Created: by goodoboy Attachments:3

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

StopLoss Order Placed on Opposite of Entry Order

  #1 (permalink)
Trading for Fun
Houston
 
Futures Experience: Beginner
Platform: ThinkorSwim, NinjaTrader,
Favorite Futures: ES,CL,NQ
 
goodoboy's Avatar
 
Posts: 83 since Dec 2016
Thanks: 27 given, 33 received

StopLoss Order Placed on Opposite of Entry Order

Hello,

I am sim testing my first strategy in NT7.

Strategy Information:
Managed Approach from the wizard with the following in NT7. I unlock the code to add additional code
I am using limit orders to enter the market, then NT auto creates a OCO bracket orders for stoploss and profit order.
EnterLongLimit()
EnterShortLimit()
SetStopLoss()
SetProfitTarget()

Problem

Sometimes (normally during high volume price action) when the entry limit order is filled, instantly I get an error (see attachment) that the stop order is placed on the profit side of the trade. For example, if a long order is filled, the stop order is being placed above the entry price. This causes the Order Rejection and causes the strategy to disable. This happen on the long and short side.

I am using a -30 tick stop loss, and after the Order Rejection occurs, I never see the market prices below my original stop loss price. So the stop loss is just plain being placed on the wrong side of the trade for no apparent reason. I never see price move more then 5-7 ticks towards the stop loss price. So may not be related to high volume.

This problem does not occur often, but it worries me when it happens. I am trading sim until problem is resolved.

I have discussed this issue with NT support on email, but they tell me somewhere in my code is the problem. I can not find the bug.

I attached my code for review and errors.

Questions

1. From your experience with NT, do you recommend I move towards UnManaged Approach? I like Managed Approach because my coding skills is still in the beginner stages and learning.

Thank you kindly.

Attached Thumbnails
StopLoss Order Placed on Opposite of Entry Order-error.jpg   StopLoss Order Placed on Opposite of Entry Order-error3.jpg  
Attached Files
Register to download File Type: txt strategy.txt (7.5 KB, 6 views)

Last edited by goodoboy; July 17th, 2017 at 10:07 AM.
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received



goodoboy View Post
Sometimes (normally during high volume price action) when the entry limit order is filled, instantly I get an error (see attachment) that the stop order is placed on the profit side of the trade. For example, if a long order is filled, the stop order is being placed above the entry price. This causes the Order Rejection. This happen on the long and short side.

This is normal and a valid rejection if price is moving quickly you have to allow for it. I can't remember all the details but here is some code I wrote a fair while back that might help.


https://futures.io/elite-circle/32822-keytrader-simple-numeric-keyboard-trading-tool-7.html#post475037


Pretty sure I got around it ok, others took the unmanaged approach, but that is much harder work and I didn't like the risk involved.

Cheers

Travel Well
Reply With Quote
 
  #4 (permalink)
Trading for Fun
Houston
 
Futures Experience: Beginner
Platform: ThinkorSwim, NinjaTrader,
Favorite Futures: ES,CL,NQ
 
goodoboy's Avatar
 
Posts: 83 since Dec 2016
Thanks: 27 given, 33 received


ratfink View Post
This is normal and a valid rejection if price is moving quickly you have to allow for it. I can't remember all the details but here is some code I wrote a fair while back that might help.


https://futures.io/elite-circle/32822-keytrader-simple-numeric-keyboard-trading-tool-7.html#post475037


Pretty sure I got around it ok, others took the unmanaged approach, but that is much harder work and I didn't like the risk involved.

Cheers

Thank you ratfink for responding.

I edit my original post to be more clearer.

I am using a -30 tick stop loss, and after the Order Rejection occurs, I never see the market prices below my original stop loss price. So the stop loss is just plain being placed on the wrong side of the trade for no apparent reason. I never see price move more then 5-7 ticks towards the stop loss price. So may not be related to high volume.

I believe NT order handling is actually placing the stop loss order on the wrong side of trade.

Have you or anyone else ever seen this issue before?

Thank you kindly.

Reply With Quote
The following user says Thank You to goodoboy for this post:
 
  #5 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


goodoboy View Post

Have you or anyone else ever seen this issue before?

No, I didn't.

Just had a quick glance at your code and you seem to be calling the Limit Entries twice

 
Code
				EnterLongLimit(0, true, DefaultQuantity, Variable1, "LONG");
				myEntryOrder = EnterLongLimit(0, true, DefaultQuantity, Variable1, "LONG"); //get the order number
Same is short case, given the same name maybe it just overrides anyway, in which case ignore.

More importantly there are lots of other states in OnOrderUpdate that might be affecting you (e.g Pending, etc), see if the code in KeyTrader can shed any light on it. I've got my head full of too much other stuff at the moment to be much of a shining light..

Cheers

Travel Well
Reply With Quote
 
  #6 (permalink)
Trading for Fun
Houston
 
Futures Experience: Beginner
Platform: ThinkorSwim, NinjaTrader,
Favorite Futures: ES,CL,NQ
 
goodoboy's Avatar
 
Posts: 83 since Dec 2016
Thanks: 27 given, 33 received


ratfink View Post
No, I didn't.

Just had a quick glance at your code and you seem to be calling the Limit Entries twice

 
Code
				EnterLongLimit(0, true, DefaultQuantity, Variable1, "LONG");
				myEntryOrder = EnterLongLimit(0, true, DefaultQuantity, Variable1, "LONG"); //get the order number
Same is short case, given the same name maybe it just overrides anyway, in which case ignore.

More importantly there are lots of other states in OnOrderUpdate that might be affecting you (e.g Pending, etc), see if the code in KeyTrader can shed any light on it. I've got my head full of too much other stuff at the moment to be much of a shining light..

Cheers

Thank you ratfink for the response and your time.

I removed the additional EnterLongLimit order. Thanks for the review.

I will respond with what I find regarding stop loss occasionally being placed on the wrong side of trade.

Thanks,

Reply With Quote
The following user says Thank You to goodoboy for this post:

Reply



futures io > > > > > StopLoss Order Placed on Opposite of Entry Order

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Place an opposite limit order as soon as my trade triggers bryan1618 Traders Hideout 2 June 20th, 2017 12:31 PM
Order entry alternatives Croni NinjaTrader 6 February 19th, 2015 10:15 AM
IB order entry grew MultiCharts 7 February 28th, 2014 02:16 PM
Quicker Order Entry RambleDog NinjaTrader 6 August 1st, 2011 02:59 AM
3 bar high/low entry maintain active order until 3 bar high/low in opposite direction mrticks NinjaTrader Programming 8 November 13th, 2009 08:44 PM


All times are GMT -4. The time now is 07:16 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-13 in 0.10 seconds with 20 queries on phoenix via your IP 54.196.182.102