Flatten All ? (Page 2) - NinjaTrader Programming | futures.io
futures.io futures trading

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Flatten All ?
Started:March 28th, 2010 (05:41 PM) by phyzfer Views / Replies:3,010 / 12
Last Reply:April 30th, 2011 (11:37 AM) Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Flatten All ?

Old April 9th, 2010, 12:34 PM   #11 (permalink)
Elite Member
New Orleans, La (Mardi Gras City)
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Ninjatrader / Optimus Futures / AmpFutures
Favorite Futures: ES / 6E / 6B / CL
DavidHP's Avatar
Posts: 926 since Aug 2009
Thanks: 738 given, 1,277 received

phyzfer View Post
7 only. It's very useful and goes around some of the idiotic NT nuances for order handling.

Yes I may have to do this too.

It seems there is an issue with 'reversing' orders in NT.
I have been testing the strategy posted in Mike's video and I changed the parameters so that you would always be short or long.

However, when you try to let the strategy reverse by entering the opposite direction, NT gives an error about 'OverFill' and disables the strategy.

I'm not sure how to proceed without managing it myself.

Do you know of another way to reverse and still use named orders
(i.e. in the strategy, 'target1', target2', 'target3' are used but when you try to use them the error is generated)

private void GoLong()
    SetProfitTarget("target1", CalculationMode.Price, Close[0] + (Target1*TickSize));
    SetProfitTarget("target2", CalculationMode.Price, Close[0] + (Target2*TickSize));
    SetProfitTarget("target3", CalculationMode.Price, Close[0] + (Target3*TickSize));


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Reply With Quote

Old April 9th, 2010, 01:15 PM   #12 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus/Zen-FIre
Favorite Futures: GC, ES
Posts: 73 since Mar 2010
Thanks: 40 given, 31 received


This is how I handle reverses without using their order handling (there in NT7).
I have a marked price (The reverseAtPrice), and I listen to each tick to see if the market has touched it. Once this price gets hit (it happens to be the SL price for one of the legs of my total quantity), I set a boolean flag to say reverseoccurred.

I then check every OnBarUpdate if this flag is true and the position is flat, if so, I enter a bunch of orders in the opposite direction.

Even if you are not using SL orders and waiting for the SL orders to kick in, you can save a "reverseAtPrice" and compare the Close[0] to it.

I hope that helps.

Reply With Quote

Old April 30th, 2011, 11:37 AM   #13 (permalink)
Elite Member
Brussels / Dublin
Futures Experience: Intermediate
Platform: ninjatrader
Favorite Futures: Stdev + 2
Posts: 466 since Jun 2010
Thanks: 838 given, 589 received

Hi David,

I also came up against the reversal issue with ninja in a trade strategy that i need.

Ive just kicked off using the SubmitOrder but aint seeing very many example code snippets in help etc specifically regarding stop setting etc.

Would you be so kind as too just paste in a few lines off code associated with u using SubmitOrder so i can take as pointers. I also see disconnect options issue listed when using the submit order and obviously i dont want that to be an issue either.

It would be a lot nicer if ninja would actually allow u to use the original ones and just hack the way the enterlong entershort is performed.

Reply With Quote


futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Flatten All ?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flatten All Positions togier NinjaTrader Programming 11 October 13th, 2012 01:55 AM

All times are GMT -4. The time now is 06:58 PM.

Copyright © 2016 by 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 2016-10-25 in 0.10 seconds with 19 queries on phoenix via your IP