Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New to Ninja and C# language need Help

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

    New to Ninja and C# language need Help

    I just got Ninja and I have no experience whatsoever with C#.
    I want to enter and exit a few seconds before the close when I have a buy or sell signal.

    I have tried with the NinjaScript Wizard but I always exit or enter on the next day's open after my strategy gives a signal.

    Can someone clearly write to me a bogus strategy that gets you in or out (@market) just a few seconds before the close of the day (i.e. 10 seconds before 4pm).

    #2
    You need to add in code a tick data series or wait for NT8

    Baruch

    Comment


      #3
      sorry but could you write me the exact NinjaScript in order to achieve what I want to do.
      I don't think I can do this with the wizard can I?

      I'm starting just now to learn C#.
      This I assume will take a few months after which I will switch to NinjaScript.

      For now, however, I would really appreciate your guidance

      Comment


        #4
        Hi Oliver,

        Relatively new myself, but have figured this one. Lets say in the strategy window you select 5mins as time frame. All strategy decisions are decided at the end of the 5min bar and so only action just after. By adding and referencing tick data you can decide tick by tick, but still use a 5min indicator such as 5min bollinger and exit the moment it passes the middle line, not at the end of thet 5min bar

        You should recognize the below section in the strategy and add tick data there.
        ************************************************** ***********
        protectedoverridevoid Initialize()
        {
        //Adding Tick data series for intrabar orders, while still using 5min indicators
        Add(PeriodType.Tick,1);
        CalculateOnBarClose =
        true;
        }
        ********************************
        Then reference it where you need to.
        *********************
        // Reference Tick data
        if (BarsInProgress == 1 )
        {
        Do Something
        }
        **************
        Be warned some of my strategies aare killing my memory as there is a lot of tick and tick decisions...currently looking at improving performance enter C# programming friend :-)


        IN the HELP file search Barsinprogress, and Add() for detailed info
        Last edited by Aussiemike; 12-20-2012, 09:45 AM.

        Comment


          #5
          This isn't a reply to this thread, however I would like to know if anyone as this specific indicator available.many thanks in advance.
          Regression Channel V2
          Exported using NT 7.0.1000.6

          This indicator is an enhanced version of the NinjaTrader Regression Channel Indicator.

          The indicator calculates the same values for the linear regression as the default NinjaTrader indicator does, but uses a modified Plot() method.

          If you scroll the chart horizontally, this indicator will display the regression channel for the last bar painted on the chart, while the NinjaTrader indicator always displays the regression channel for the last bar of the data base.

          To understand how it works, just put both indicators - the NinjaTrader default indicator and this indicator - on your chart and scroll horizontally, and you will notice the difference.

          Update July 23, 2011: Indicator updated to work with non-equidistant bar spacing, as used by multi-series charts.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pechtri, 06-22-2023, 02:31 AM
          9 responses
          122 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by frankthearm, 04-18-2024, 09:08 AM
          16 responses
          66 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by habeebft, Today, 01:18 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by benmarkal, Today, 12:52 PM
          2 responses
          14 views
          0 likes
          Last Post benmarkal  
          Started by f.saeidi, Today, 01:38 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X