Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using a bigger chart for calculation

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

    Using a bigger chart for calculation

    Hi All

    I am using Stochastic in a strategy that triggers a trade if Overbought or Oversold

    so far so good but i would like it to look at the OB/OS on a bigger Range chart

    Let say i am using a 4 range to trade but would like to use the OB/OS trigger from a 7 Range

    Can this be done and if yes could you point me in the right direction

    Thank you

    #2
    Hello richbois,
    Thanks for your post and I am happy to assist you.

    You can use a multi-timeframe strategy to achieve the same.
    To get more idea on multi-timeframe/instrument concept please refer here http://www.ninjatrader.com/support/h...nstruments.htm

    Please see the SampleMultiTimeFrame strategy that comes with NinjaTrader to get more details (in Control Center menu bar, goto Tools>Edit NinjaScript>Strategies…, in the Strategies dialog select SampleMultiTimeFrame and click on the Ok button).

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thank you for your prompt response

      Will work on that in the morning

      Richard

      Comment


        #4
        Hello Richard,
        Good to know.

        Please do not hesitate to contact us if you need any further assistance.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I added this in the initialize section

          Add(PeriodType.Range, 7);
          Add (Stochastics(PeriodD, PeriodK, Smooth));

          Now i am trying to use the D of the Stochastics

          double stochB = Stochastics(BarsArray[0],.D);

          that gets rejected

          I am not on the On Bar Update section but in a Check Entry section

          But i get a syntax error so probably my code line is wrong

          Comment


            #6
            Hello Richard,
            You cannot place the BarsArray[0] in the Initialize section. You have to put the same in the OnBarUpdate event.

            A basic code will look like
            Code:
            protected override void Initialize()
            {
            	Add(PeriodType.Range, 7);
            }
            Code:
            protected override void OnBarUpdate()
             {
            	//of the secondary data series crosses above 80 do something
            	if (CrossAbove(Stochastics(Closes[1], periodD, periodK, smooth),  80, 1))
            	{
            		//do something
            	}
            }
            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              I did what you said and i dont get errors
              but i am not sure i am getting the right result

              In that strategy I have 2 different Stochastics 1 on 4R and this new one on 7R

              The 7R seems to be giving me signals as per Print debug but it is not constant and How do i know if i am using the K or the D of the stoch.
              Attached Files
              Last edited by richbois; 02-09-2012, 10:08 AM. Reason: add attachement

              Comment


                #8
                Hello Richard,
                Please put up a chart of 7 range, apply the stochastic indicator on it with the same parameters as in the multi-timeframe strategy and compare the same with that of the strategy.

                To know whether you are using D or K, explicitly assign the same for example
                Code:
                double dValue = Stochastics(periodD, periodK, smooth).D[0];
                Please let me know if I can assist you any further.
                Last edited by NinjaTrader_Joydeep; 02-09-2012, 10:42 AM.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  I did that and that is the reason i dont think it works

                  can i email you the whole thing so you can see better?????????

                  Comment


                    #10
                    Hello Richard,
                    Please email the same at support[AT]ninjatrader[DOT]com

                    In the subject line of the email please write Attn:Joydeep and in the body please give a reference of this thread.

                    I look forward to assist you further.
                    JoydeepNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    574 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X