program a limit order in a strategy - NinjaTrader Programming | futures io social day trading
futures io futures trading


program a limit order in a strategy
Updated: Views / Replies:3,871 / 18
Created: by bob998 Attachments:0

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
 

program a limit order in a strategy

  #11 (permalink)
Elite Member
Denver, CO
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES
 
NinjaTrader's Avatar
 
Posts: 1,260 since May 2010
Thanks: 153 given, 1,890 received


monpere View Post
A 3 tick offset would be: EnterShortLimit(1, Close[0]-(3*TickSize), "SMA");


If want to get into the market, I would not offset the current close price by 3 ticks, I would offset the current bid if selling or the current ask if buying. I would also use the methods GetCurrentAsk() and GetCurrentBid() to retrieve those prices. This will give you the best chance of getting filled at market.

Reply With Quote
The following 4 users say Thank You to NinjaTrader for this post:
 
  #12 (permalink)
Elite Member
West Palm Beach, FL
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: TF, NQ ES,CL,6E
 
Posts: 6 since Mar 2012
Thanks: 1 given, 0 received

Thank you.

How would I add a time period to it. To only trade between certain hours?

Reply With Quote
 
  #13 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received



NinjaTrader View Post
If want to get into the market, I would not offset the current close price by 3 ticks, I would offset the current bid if selling or the current ask if buying. I would also use the methods GetCurrentAsk() and GetCurrentBid() to retrieve those prices. This will give you the best chance of getting filled at market.

Interesting. I may need to reconsider how I code that in my own strategies. My approach is generally I want to enter at market, but not if the price has already moved x ticks away from the last traded price. Why would an offset on the bid or ask give a better chance to get filled at market? Because of potential large spread of certain instruments?


Last edited by monpere; April 24th, 2012 at 01:28 PM.
Reply With Quote
 
  #14 (permalink)
Elite Member
Denver, CO
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES
 
NinjaTrader's Avatar
 
Posts: 1,260 since May 2010
Thanks: 153 given, 1,890 received


bob998 View Post
Thank you.

How would I add a time period to it. To only trade between certain hours?

Check out this reference sample on time filtering - Strategy: Using a time filter to limit trading hours - NinjaTrader Support Forum

Reply With Quote
 
  #15 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received


bob998 View Post
Thank you.

How would I add a time period to it. To only trade between certain hours?

 
Code
if (ToTime(Time[0]) > 83000 && ToTime(Time[0]) < 133000)
...do something

Reply With Quote
 
  #16 (permalink)
Elite Member
Denver, CO
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES
 
NinjaTrader's Avatar
 
Posts: 1,260 since May 2010
Thanks: 153 given, 1,890 received


monpere View Post
Interesting. I may need to reconsider how I code that in my own strategies. My approach is generally I want to enter at market, but not if the price has already moved x ticks away from the last price on my chart. Why would an offset on the bid or ask give a better chance to get filled at market? Because of potential large spread of certain instruments?

If you want to enter market with limit based on an offset from the last price on your chart then your approach is correct. If you want to enter at market, then there are several reasons for offsetting the bid/ask price:

- For example, it is very possible that Close - 3 tick offset to sell might be still greater than the bid price --> No fill
- GetCurrentAsk() and GetCurrentBid() return the current prices which is especially in fast moving markets will be more recent/ahead of the event driven OnMarketData(). This is due to the asynchronous aspect of the actual market data/brokerage adapter.

Reply With Quote
The following 2 users say Thank You to NinjaTrader for this post:
 
  #17 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received


NinjaTrader View Post
If you want to enter market with limit based on an offset from the last price on your chart then your approach is correct. If you want to enter at market, then there are several reasons for offsetting the bid/ask price:

- For example, it is very possible that Close - 3 tick offset to sell might be still greater than the bid price --> No fill
- GetCurrentAsk() and GetCurrentBid() return the current prices which is especially in fast moving markets will be more recent/ahead of the event driven OnMarketData(). This is due to the asynchronous aspect of the actual market data/brokerage adapter.

Yes, thanks. If trading an instrument with occasional large spread, then I don't want the order executed if the spread is larger then x ticks at the moment. If trading a fast instrument, then I don't want the order executed if there is a fast move greater then x ticks away from my intended price. In both cases I want a No Fill.

Reply With Quote
 
  #18 (permalink)
Elite Member
West Palm Beach, FL
 
Futures Experience: Intermediate
Platform: Ninja
Favorite Futures: TF, NQ ES,CL,6E
 
Posts: 6 since Mar 2012
Thanks: 1 given, 0 received

if I add -3 ticks on the short order and it isn't met, how can I tell to keep try till it is?

Reply With Quote
 
  #19 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received


bob998 View Post
if I add -3 ticks on the short order and it isn't met, how can I tell to keep try till it is?

I said 3 ticks, just as an example. I think the actual number of ticks you would use would depend on the instrument you are trading because of any of the reasons mentioned above. Also depends on your trading methodology. It could be 1000 ticks if you just want to enter the market at any price for example. I generally trade instruments with very tight spreads so 3 ticks is plenty for me, others may require more to guarantee a fill. Also, for me there is a certain price after which I no longer want that trade. For instance, I don't want to enter 5 ticks away from the last trade price, if my profit target is 10 ticks away from that last traded price. Half my potential profit would be gone, so that trade is not worth for me at that price.

Reply With Quote

Reply



futures io > > > > > program a limit order in a strategy

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
STUCK LIMIT ORDER ShruggedAtlas NinjaTrader 3 September 8th, 2011 10:29 PM
Chasing a limit order entry in an auto-strategy nanobiotech Elite Automated Trading 7 August 17th, 2011 06:39 AM
Stop Limit Order Big Mike Terms (Glossary) 0 July 2nd, 2010 12:37 PM
Limit Order LukeGeniol Terms (Glossary) 0 June 29th, 2010 02:38 AM
Stop Limit Order with InteractiveBrokers tom1 NinjaTrader 2 June 20th, 2010 11:29 AM


All times are GMT -4. The time now is 07:46 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-11 in 0.18 seconds with 37 queries on phoenix via your IP 54.226.132.197