Limit Order and Trailing Stop - NinjaTrader Programming | futures io social day trading
futures io futures trading


Limit Order and Trailing Stop
Updated: Views / Replies:3,693 / 7
Created: by Tiger45 Attachments:1

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
 

Limit Order and Trailing Stop

  #1 (permalink)
Elite Member
San Diego, CA, USA
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: CL, ES
 
Tiger45's Avatar
 
Posts: 309 since Sep 2010
Thanks: 203 given, 422 received

Limit Order and Trailing Stop

Hi,
I'd like to create a strategy where a stop limit order is placed after a condition is met, then cancel this order X bars later if not filled. If it is filled, I'd like to trail the stop based upon the previous bar's close.

For example, on a long trade, after the condition is met, I'd like an order placed below the market. After X bars and not filled, cancel the order. If the order is filled, I'd like the stop to be set on the low of the previous bar, then trail up on the close with each bar.

Can someone give me a push in the right direction?

Thanks.

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
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received

Maybe ...



Tiger45 View Post
Hi,
I'd like to create a strategy where a stop limit order is placed after a condition is met, then cancel this order X bars later if not filled. If it is filled, I'd like to trail the stop based upon the previous bar's close.

For example, on a long trade, after the condition is met, I'd like an order placed below the market. After X bars and not filled, cancel the order. If the order is filled, I'd like the stop to be set on the low of the previous bar, then trail up on the close with each bar.

Can someone give me a push in the right direction?

Thanks.

I hope someone more experienced can jump in here: I have seen conditions where the limit order was not accepted by the broker because it was too outside the bounds of the market activity, but, I cant recall the exact details. Thi is just offered for discussion, sorry I cant be more specific: I felt it might have a consideration in your design.

TJ

Reply With Quote
 
  #4 (permalink)
Elite Member
Asia
 
Futures Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received

Ironically I just got a strat that uses BuyStopLimit and SellStopLimit working overnight! I was getting order rejections but I think that is solved.

Let me have a coffee and I'll post some code here.

Reply With Quote
The following 2 users say Thank You to MXASJ for this post:
 
  #5 (permalink)
Elite Member
Asia
 
Futures Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received

I have a strategy that uses a custom indicator. That indicator plots levels at which I want to enter with either a EnterLongStop() or a EnterShortStop(). I was having issues if Close[0] was above the Long level, for example.

I did two things. The first got rid of 90% of the errors. Sample code:

 
Code
                            
 
if (GoLongOK && Close[0]<MyTradeLogic().LongEntryLevel[0])
{
    
EnterLongStop(DefaultQuantityMyTradeLogic().LongEntryLevel[0], "MyLong")

The logic being if price has already moved above my LongEntryLevel, I don't want to submit a EnterLongStop order (though I might want a Limit order, which would require other code).

Alas 90% isn't good enough so I went back to the custom indicator and added a variable that I could access in the Strategy so that BOTH the indicator and the strategy were better hard wired to unambiguosly allow a long or a short. I tracked that issue through using print statements and found the indicator would sometimes allow the opposite of what I wanted and that would result in rejected orders.

The basis for the indicator upgrade code can be found here:

Indicator: Exposing indicator values that are not plots - NinjaTrader Support Forum

Hope that helps.

EDIT: Attached the SampleCancelOrder example from the Ninja forum that shows how to cancel or amend an order after n bars. It uses IOrders though.

Attached Files
Register to download File Type: zip SampleCancelOrder.zip (2.1 KB, 97 views)
Reply With Quote
The following 6 users say Thank You to MXASJ for this post:
 
  #6 (permalink)
Elite Member
San Diego, CA, USA
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: CL, ES
 
Tiger45's Avatar
 
Posts: 309 since Sep 2010
Thanks: 203 given, 422 received


MXASJ View Post

Hope that helps.

EDIT: Attached the SampleCancelOrder example from the Ninja forum that shows how to cancel or amend an order after n bars. It uses IOrders though.

Thanks for this. I'll play with it tonight.

Reply With Quote
 
  #7 (permalink)
Elite Member
Minneapolis, MN, USA
 
Futures Experience: Master
Platform: ninjatrader, TOS
Favorite Futures: Weekly Options
 
Vikings1's Avatar
 
Posts: 188 since Oct 2011
Thanks: 26 given, 407 received

ATR Trailing Stop

Good afternoon to everyone who uses Ninja,

I am a very experienced trader, but not in using the Ninja format. Can you Autotrade in Ninja using a "ATR Trailing Stop" If so, can someone help me out and show me how to do it? I have searched all over the place and just can seem to find how, but I know it must be possible.

My set-up is just a onder thing and I have no problem programming that part of it, just want to be able to add an ATR Trailing stop as my stop out instead of a standard trailing stop.

Thanks.

Vikings

Reply With Quote
 
  #8 (permalink)
Mariolmb
Montreal
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Stocks
 
Posts: 2 since Jan 2012
Thanks: 0 given, 0 received

Atr stop

Hello Vicking1,

just seen your question.
May be very late,
I tried to find about the same as you,
an ATR volatility stop.
Did you receive answer to your question.
If yes, did you receive it from BigMike forum.
And is it possible for me to get it.

If you didn't get answer.
I tried to find it on my side and can't.

But I found something could help you.
It's on ninjacators site.
Cost little buck, (around 97$)but if you can't find it free,
and if it's what you want.
They call "ATR trailing stop"

I got an indicator from them who work as promise.


Thanks

Mariolmb

Reply With Quote

Reply



futures io > > > > > Limit Order and Trailing Stop

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Entering into a trade with a trailing stop order? Arpad Traders Hideout 6 February 7th, 2011 10:55 AM
MC - Coding for Stop Limit Order arjfca The Elite Circle 2 January 25th, 2011 06:18 AM
Sell Stop limit order PowerM NinjaTrader 10 September 17th, 2010 02:41 PM
Stop Limit Order Big Mike Terms (Glossary) 0 July 2nd, 2010 12:37 PM
Stop Limit Order with InteractiveBrokers tom1 NinjaTrader 2 June 20th, 2010 11:29 AM


All times are GMT -4. The time now is 01:16 PM.

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-14 in 0.12 seconds with 20 queries on phoenix via your IP 54.234.255.29