Prevent strategy from executing trade at the same price level within a session - NinjaTrader Programming | futures io social day trading
futures io futures trading

Prevent strategy from executing trade at the same price level within a session
Updated: Views / Replies:1,168 / 1
Created: by suprsnipes 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

Prevent strategy from executing trade at the same price level within a session

  #1 (permalink)
Just starting out...
Melbourne, Australia
Futures Experience: Advanced
Platform: Custom
suprsnipes's Avatar
Posts: 6 since Nov 2009
Thanks: 4 given, 0 received

Prevent strategy from executing trade at the same price level within a session

I have been researching the following topic of saving a variable in NT for use within a strategy to prevent the strategy from executing at the same price more than once within a session and I'm having some trouble trying to get it to compile.

If anyone one has the chance to review the code attached I would appreciate any help you can provide...

// Copyright (C) 2007, NinjaTrader LLC 
// NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
    /// <summary>
    /// Sample strategy 
    /// </summary>
    [Description("Sample strategy")]
    public class MyCustomStrategy : Strategy
        #region Variables
        double myEntryOrder        =     Position.AvgPrice;
        /// <summary>
        /// This method is used to configure the strategy and is called once before any strategy method is called.
        /// </summary>

        protected override void Initialize()
            SetStopLoss("", CalculationMode.Ticks, 25, false);
            SetProfitTarget("", CalculationMode.Ticks, 6);

            CalculateOnBarClose = false;
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
            // Condition set 1
            if (CurrentDayOHL().CurrentLow[0] >= IY().IU[0]
                && Position.MarketPosition == MarketPosition.Flat
                && BarsSinceExit() > 40 && myEntryOrder != IY().IU[0])
                myEntryOrder = EnterLongLimit(DefaultQuantity, IY().IU[0], "");
        #region Properties
Thank you 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.


futures io > > > > > Prevent strategy from executing trade at the same price level within a session

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

July Journal Challenge - $500 in Amazon Gift Cards!


Battlestations: $750 in prizes - Show us your trading desk!


TBA: FuturesTrader71 w/Morad Askar

Elite only

Similar Threads
Thread Thread Starter Forum Replies Last Post
Time and Sales - Level I - Level II - tick data trendisyourfriend Traders Hideout 4 August 28th, 2014 12:14 AM
executing strategy in backtesting cicondo NinjaTrader Programming 11 May 5th, 2011 08:13 AM
Defining the range where the bulk of the session's price action could take place trendisyourfriend The Elite Circle 2 September 15th, 2010 12:19 PM
The Intensity of Commercial Trade at Local & Session Extremes UrmaBlume NinjaTrader 6 August 25th, 2010 10:23 PM
Need Level II and Level I realtime or historical data ptd26 Reviews of Brokers and Data Feeds 5 March 26th, 2010 03:27 PM

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

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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 2018-07-23 in 0.07 seconds with 14 queries on phoenix