Global Variables and Strategies in Ninja 6.5 - NinjaTrader Programming | futures io social day trading
futures io futures trading

Global Variables and Strategies in Ninja 6.5
Updated: Views / Replies:2,020 / 3
Created: by TonyA 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 100,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

Thread Tools Search this Thread

Global Variables and Strategies in Ninja 6.5

  #1 (permalink)
Elite Member
Toronto, Ontario
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: zenfire
Favorite Futures: 6E
TonyA's Avatar
Posts: 2 since Aug 2009
Thanks: 4 given, 0 received

Global Variables and Strategies in Ninja 6.5


Hoping to get some direction from someone in the forum.

Originally I started down the path of creating a strategy that would use the OCO concept by having a long and a short both created in a strategy and when one order was triggered the other would be cancelled. I researched the Ninja forum and discovered that one cannot place a short and a long from the same strategy ( this is also confirm by Josh in one of his replies). However, some managed to get both orders into the dom by using 2 strategies, one for the long and another for the short. Bertrand mentioned that one could use global variables to acomplish the equivalent of an OCO and once the order is triggered on one side an update to the global variable could be made and the other strategy could just cancel the other side of the order. The use of global variables is not support in the forum and no direction is provided.

this is the ninja forum post
Gloabal Variables? - Page 2 - NinjaTrader Support Forum
look at post 24.

I was hoping someone could kindly point me in the correct direction as to how to create the DLL and access it with the snippet of code provided in ninja forum.



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
Rennes France
Trading Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
sam028's Avatar
Posts: 3,542 since Jun 2009
Thanks: 3,721 given, 4,265 received

There is an easy way to do this, maybe not the cleanest/faster way, but easy: let your variable be a file.
In the Long strategy, if the order is triggered, and their is no "short.txt" file, create a file "long.txt".
In the Short strategy, check if a file named long.txt exists, and don't take the trade if yes.
Much easier to do than writing a .dll which manage a GV.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following user says Thank You to sam028 for this post:
  #4 (permalink)
Elite Member
Toronto, Ontario
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: zenfire
Favorite Futures: 6E
TonyA's Avatar
Posts: 2 since Aug 2009
Thanks: 4 given, 0 received

Thank You Sam

Have yet to see the global variable approach anywhere in an example.

However I believe have seen an example of file usage you describe in one of the indicators in the forum.

I'll see if i can find it. At least i will have something to go by.

Thank you kindly


Reply With Quote


futures io > > > > > Global Variables and Strategies in Ninja 6.5

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now

Pro Trader vs Pro Athlete w/Brannigan Barrett @ Habitus Capital

Elite only

60 Minutes to Better Decisions & Better Trades w/Agustin Lebron

Elite only

Live Day Trading the E-MICROS w/Ilan @ Cannon (special time: 12PM ET)

May 30

Similar Threads
Thread Thread Starter Forum Replies Last Post
Global Variables (GV) in EasyLanguage for TradeStation/MultiCharts Big Mike EasyLanguage Programming 19 October 29th, 2013 03:07 PM
global variables: anyone got a complete NT7 example? elbone NinjaTrader Programming 2 July 19th, 2011 09:13 AM
Exposing variables kaywai NinjaTrader Programming 4 April 14th, 2011 11:58 AM
Experience Trading LIVE automated Strategies with Ninja ??? gtichauer The Elite Circle 6 April 28th, 2010 05:56 PM
Does anyone esle find Ninja problematic for optimizing strategies? rsi77 NinjaTrader 3 June 17th, 2009 08:32 PM

cancelled, code, dom, dow, es, est, global variables, how to, indicators, information, ninja, ninjascript, ninjatrader, orders, short, strategies, strategy, support, txt, update, variable

All times are GMT -4. The time now is 06:54 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business,
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 2019-05-22 in 0.20 seconds with 14 queries on phoenix