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,879 / 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

  #1 (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

program a limit order in a strategy

I have a strategy trading the TF after hours, after 16:15 est, and it won't let it put in a market order. How would I code it to a limit at ask order? I'm not a programer.

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)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received


Something like
 
Code
                            
EnterShortLimit(GetCurrentAsk()); 


Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #4 (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

Thanks, I can't get it to compile. Here is what I have:

// Checks if the 5 period SMA is below the 50 period SMA on both the 5 and 15 minute time frames
if (SMA(BarsArray[1], 5)[0] < SMA(BarsArray[1], 50)[0] && SMA(BarsArray[2], 5)[0] < SMA(BarsArray[2], 50)[0])


if (CrossBelow(SMA(5), SMA(50), 1))
EnterShortLimit(GetCurrentAsk) ( )); (1, "SMA");
}

I have tried just EnterShortLimit (GetCurrentAsk) ()); , but this doesn't work either.
and EnterLongLimit(GetCurrentAsk)(0 ));


EnterShort(1, "SMA"); works but only as market order.

Reply With Quote
 
  #5 (permalink)
Elite Member
Atkinson, NH USA
 
Futures Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker/Data: NinjaTrader Brokerage
Favorite Futures: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,925 since Dec 2010
Thanks: 2,962 given, 2,294 received


bob998 View Post
Thanks, I can't get it to compile. Here is what I have:

// Checks if the 5 period SMA is below the 50 period SMA on both the 5 and 15 minute time frames
if (SMA(BarsArray[1], 5)[0] < SMA(BarsArray[1], 50)[0] && SMA(BarsArray[2], 5)[0] < SMA(BarsArray[2], 50)[0])


if (CrossBelow(SMA(5), SMA(50), 1))
EnterShortLimit(GetCurrentAsk) ( )); (1, "SMA");
}

I have tried just EnterShortLimit (GetCurrentAsk) ()); , but this doesn't work either.
and EnterLongLimit(GetCurrentAsk)(0 ));


EnterShort(1, "SMA"); works but only as market order.

Here is the reference fo the command:
EnterShortLimit()

Your line here has some problem:
EnterShortLimit(GetCurrentAsk) ( )); (1, "SMA");

The proper syntax for this line should be:
EnterShortLimit(1,GetCurrentAsk( ), "SMA");

Try that...

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Reply With Quote
The following user says Thank You to NJAMC for this post:
 
  #6 (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

That worked ,Thank you VERY MUCH!

Reply With Quote
 
  #7 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


bob998 View Post
I have a strategy trading the TF after hours, after 16:15 est, and it won't let it put in a market order. How would I code it to a limit at ask order? I'm not a programer.

There may be a problem with market orders and the GTC setting, so you can also try to replace GTC with Day. This may depend on your broker.

Reply With Quote
 
  #8 (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


NJAMC View Post
Here is the reference fo the command:
EnterShortLimit()

Your line here has some problem:
EnterShortLimit(GetCurrentAsk) ( )); (1, "SMA");

The proper syntax for this line should be:
EnterShortLimit(1,GetCurrentAsk( ), "SMA");

Try that...

Wouldn't offset by a few ticks instead of GetCurrentAsk() have a better chance for a fill, since you are trying to simulate a market order?

Reply With Quote
 
  #9 (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

Yes that would be great. How should I add it?

Reply With Quote
 
  #10 (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
Yes that would be great. How should I add it?

A 3 tick offset from the last price would be: EnterShortLimit(1, Close[0]-(3*TickSize), "SMA");

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 03:52 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-12 in 0.12 seconds with 37 queries on phoenix via your IP 54.163.210.170