Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Newbee Question Auto Trading

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Newbee Question Auto Trading

    I have been out of the market since 2006. I had experience with Trade station automatic trading through Trade station. I just downloaded Ninja trader with zenfire data feed, which I was told could innate automatic trading using Ninja script from my broker.

    I have a demo live feed with Proactive Futures zen fire and the simulated feed from Ninja.
    Just to get my feet wet I took the SampleMovingAverageCrossover strategy and modified it, compiled it and saved it as a new strategy (MaCrossover) only changing the fast and slow values to generate some fast trades.

    I set up the indicator ZN 03-11, selected the demo feed, loaded the strategy and activated it. I set the trend to rise fast and expected to see it make an order. No such luck.
    I have read what I could find in the online manual but no amount of playing will get it to make a trade.
    Can someone point me to a thread or something so I can find out what I am not doing?
    Here is the strategy I'm using. If I can get this thing to trade I will be good.

    thanks
    //

    #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;
    #endregion

    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    /// <summary>
    /// Simple moving average cross over strategy.
    /// </summary>
    [Description("moving average cross over strategy.")]
    public class MACrossOver : Strategy
    {
    #region Variables
    private int fast = 5;
    private int slow = 25;
    #endregion

    /// <summary>
    /// This method is used to configure the strategy and is called once before any strategy method is called.
    /// </summary>
    protected override void Initialize()
    {
    SMA(Fast).Plots[0].Pen.Color = Color.Orange;
    SMA(Slow).Plots[0].Pen.Color = Color.Green;

    Add(SMA(Fast));
    Add(SMA(Slow));

    CalculateOnBarClose = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick).
    /// </summary>
    protected override void OnBarUpdate()
    {
    if (CrossAbove(SMA(Fast), SMA(Slow), 1))
    EnterLong(1);
    else if (CrossBelow(SMA(Fast), SMA(Slow), 1))
    EnterShort(1);
    }

    #region Properties
    /// <summary>
    /// </summary>
    [Description("Period for fast MA")]
    [GridCategory("Parameters")]
    public int Fast
    {
    get { return fast; }
    set { fast = Math.Max(1, value); }
    }

    /// <summary>
    /// </summary>
    [Description("Period for slow MA")]
    [GridCategory("Parameters")]
    public int Slow
    {
    get { return slow; }
    set { slow = Math.Max(1, value); }
    }
    #endregion
    }
    }

    #2
    Larry, if you use the simulated demo feed, please keep in mind this will not offer any historical data and thus it might take a few bars to calculate any entry resulting from the SMA's. If you for example open up a stock chart using our free Yahoo or Kinetick end of day connection, and then apply the strategy to a daily chart, would you then see trades showing in backtesting?

    Thanks,
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I downloaded data for 20 days, so it had enough. When the market opened today it started trading.
      Now I have another question. In the case of the program moving average crossover I found out that I start the chart first, then select the strategy, then go to the strategy and enable. Eventually when there is a signal it will start trading. However if I want it to take a position when I start the strategy how do I do that?
      For instance at start its just after a long crossover I want to take a long position then let it go on its own.

      I also don't understand the sync'ing. I have enabled it but I don't know why.
      thanks again.
      Last edited by larrylwill; 12-03-2010, 01:09 PM.

      Comment


        #4
        larrylwill,

        What you want to do is to go to Tools>Options>Strategies>NinjaScript and select "Immediately submit" instead of "Wait until flat".

        When you use sync position, what it does is sees that your strategy is in a long position and it will automatically place in a long trade to match that long position to your account so everything syncs up between your strategy position and your account position.

        Please see this page for more information on all of this: http://www.ninjatrader.com/support/h..._positions.htm
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          yes I read that late last night but forgot about it today.
          This is a lot different than trade station was.

          Thank you again.

          Comment


            #6
            Thanks for the info.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,406 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            98 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            8 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            160 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            9 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X