NEED HELP TO WRITE MY FIRST STRATEGY - NinjaTrader Programming | futures io social day trading
futures io futures trading

Updated: Views / Replies:610 / 2
Created: by benwincky 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


  #1 (permalink)
Brussels Belgium
Trading Experience: Beginner
Platform: Ninjatrader
Favorite Futures: Forex
Posts: 14 since Mar 2013
Thanks: 5 given, 0 received


Hello to you

I can manipulate my edit script by now

But I'm nowhere, let's be honnest. There are so many commands that you would save me time indicating me whitch set of command I could Start with for my first «own scrpit*»

I read a lot in the forum but didn't find what I want or maybe came accross without noticing that was the command Iwas looking for.

I will give and example I think this is the best way

I intend working this way

protected override void Initialize()

CalculateOnBarClose = False;

I'm not interested in bars closed though I know it is CPU intensive

I have the EURJPY a 120,55

I will write this example for a long entry but the logic would be the same if I would go short

As I enable my strategy, I want this 120,55 value stored in a «*double*» variable

(This is my first problem, I have been unable to find a way for doing so)

Let's say The EURJPY moves up 1 pip up to 120,56

At time I want to start a stop watch to 0 second

First case

The EURJPY moves up 4 more pips to 120,60 within 3 seconds, I would enter long

Second Case

3 seconds have elapsed and the EURJPY moved up to 120,59

It didn't fill my condtions to enter long and the stop watch resets to Zero

Third Case

The EURJPY went up to 120,58 and then back down to 120,57. Well, it didn't fill my conditions either


It might be a new begining of a short entry process

I went down one pip, didn't he*?

I now want the 120,58 stored in my double Variable and restart a stop wath to Zero

And If the EURJPY moved down within 3 second I enter Short.


1. How to I do To get the Actual Value of the EURJPY in a variable as I start my strategy.
2. How do I start a stop watch

Thanks in advance


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)
Trading Experience: None
Platform: None Yet
Favorite Futures: Guitar
MrYou's Avatar
Posts: 403 since Jun 2011
Thanks: 618 given, 194 received

My suggestion is to forget about this "stop watch" stuff. You need to understand how charts and NinjaScript work. I can't explain it all, but below is some simple code.

Add() a 3 second chart or base your primary bars (BarsInProgress == 0) off the 3 second chart.

CalculateOnBarClose = true;

if (BarsInProgress == 0)
   if (Close[0] - Open[0] > TickSize * 3)
OR for Multi-Timeframe: Add(PeriodType.Second, 3)

if (Closes[1][0] - Opens[1][0] > TickSize * 3)

Reply With Quote
The following user says Thank You to MrYou for this post:



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

Thanks for everything -- $250 in Amazon Gift Cards ready to give away

Right now

Journal in July -- over $2,500 in prizes w/NinjaTrader


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best way to write a NT strategy with the wizard? mkaminski NinjaTrader 2 October 21st, 2012 12:43 PM
Need Programmer to Write Ninja Strategy hcoffin1941 NinjaTrader Programming 28 November 21st, 2011 08:44 AM
Italy-Pregnant BlackRock Sees Write-Downs Of 75-80% For Greece, Portugal And Ireland Quick Summary News and Current Events 0 November 14th, 2011 11:30 AM
How do I write a trading plan? skyfly Traders Hideout 5 May 20th, 2011 01:13 AM
How do I write the script for kaywai NinjaTrader Programming 1 January 19th, 2010 10:06 AM

barsinprogress, charts, code, dow, es, est, eurjpy, how to, information, ma, ninjascript, ninjatrader, strategy, timeframe

All times are GMT -4. The time now is 11:30 PM. (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