Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy with renko..problem in backtest

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

    #16
    Excuse me...i'm confused







    Thje chart is empty

    i don't see historical order

    Comment


      #17
      Originally posted by esignal View Post
      There must be something else wrong on your end. The pictures tell the story.

      Here is the code:
      Code:
      #region Using declarations
      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.ComponentModel.DataAnnotations;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Gui;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Gui.SuperDom;
      using NinjaTrader.Data;
      using NinjaTrader.NinjaScript;
      using NinjaTrader.Core.FloatingPoint;
      using NinjaTrader.NinjaScript.Indicators;
      using NinjaTrader.NinjaScript.DrawingTools;
      #endregion
      
      //This namespace holds Strategies in this folder and is required. Do not change it. 
      namespace NinjaTrader.NinjaScript.Strategies
      {
      	public class ntforumesignal : Strategy
      	{
      		protected override void OnStateChange()
      		{
      			if (State == State.SetDefaults)
      			{
      				Description							= @"Enter the description for your new custom Strategy here.";
      				Name								= "ntforumesignal";
      				Calculate							= Calculate.OnBarClose;
      				EntriesPerDirection					= 1;
      				EntryHandling						= EntryHandling.AllEntries;
      				IsExitOnSessionCloseStrategy		= true;
      				ExitOnSessionCloseSeconds			= 30;
      				IsFillLimitOnTouch					= false;
      				MaximumBarsLookBack					= MaximumBarsLookBack.TwoHundredFiftySix;
      				OrderFillResolution					= OrderFillResolution.Standard;
      				Slippage							= 0;
      				StartBehavior						= StartBehavior.AdoptAccountPosition;
      				TimeInForce							= TimeInForce.Gtc;
      				TraceOrders							= false;
      				RealtimeErrorHandling				= RealtimeErrorHandling.StopCancelClose;
      				StopTargetHandling					= StopTargetHandling.PerEntryExecution;
      				BarsRequiredToTrade					= 20;
      			}
      			else if (State == State.Configure)
      			{
      			}
      		}
      
      		protected override void OnBarUpdate()
      		{
      			//Add your custom strategy logic here.
      			if (CrossAbove(Close,Open,1)) EnterLongStopLimit(Close[0]+1 * TickSize,Close[0]); 
      			else if (CrossBelow(Close,Open,1)) EnterShortStopLimit(Close[0]-1 * TickSize,Close[0]);
      		}
      	}
      }
      I do not have access to an FDAX data feed, so I used the SPY. As I could not be bothered to determine what "1 Point" means relative to FDAX, given what your original intent seemed to be, I deduce that you really want an offset of "1 tick", not "1 point", so that is what I coded. I cannot tell offhand if that is your actual problem: specifying an offset of "1 point" instead of "1 tick".

      What this demonstrates is that the problem is your code, not NT.
      Attached Files
      Last edited by koganam; 02-18-2016, 11:09 AM.

      Comment


        #18
        I can see that your chart is empty. I am saying that your original question was talking about UniRenko or something, and that the picture you are now showing is 15m bars, so I will demonstrate on 15m bars, as I do not have UniRenko bars.

        Does that clear it up?

        I have posted demo code and the results thereof.
        Last edited by koganam; 02-18-2016, 12:33 PM.

        Comment


          #19
          [/CODE]
          I do not have access to an FDAX data feed, so I used the SPY. As I could not be bothered to determine what "1 Point" means relative to FDAX, given what your original intent seemed to be, I deduce that you really want an offset of "1 tick", not "1 point", so that is what I coded. I cannot tell offhand if that is your actual problem: specifying an offset of "1 point" instead of "1 tick".

          [/QUOTE]

          Ok..now i understand...i appreciate your patience..

          how i do specify an offset of "1 point" instead of "1 tick" ?

          Comment


            #20

            Ok..now i understand...i appreciate your patience..

            how i do specify an offset of "1 point" instead of "1 tick" ?
            You write what you originally wrote: do not multiply the "1" by TickSize.

            That looks like the attached picture.
            Attached Files
            Last edited by koganam; 10-01-2016, 10:40 AM.

            Comment


              #21
              Excuse me....i've problem to write a good english. ....
              I ask you:what i write to specify an offset to 1 point?

              Comment


                #22
                Originally posted by esignal View Post
                Excuse me....i've problem to write a good english. ....
                I ask you:what i write to specify an offset to 1 point?
                I said that you should use what you originally wrote, here: http://ninjatrader.com/support/forum...72&postcount=1

                Comment


                  #23
                  if (CrossAbove(Close,Open,1))
                  EnterLongStopLimit(Close[0]+1,Close[0]);
                  else if (CrossBelow(Close,Open,1))
                  EnterShortStopLimit(Close[0]-1,Close[0]);
                  Ok..this is not corret..

                  I ask you : how do i write to use an offset of 1 point?

                  thanks

                  Comment


                    #24
                    Originally posted by esignal View Post
                    Ok..this is not corret..

                    I ask you : how do i write to use an offset of 1 point?

                    thanks
                    That is it! I do not know what else to say.

                    Comment


                      #25
                      Ok..thanks you...

                      I try your script


                      #region Using declarations
                      using System;
                      using System.Collections.Generic;
                      using System.ComponentModel;
                      using System.ComponentModel.DataAnnotations;
                      using System.Linq;
                      using System.Text;
                      using System.Threading.Tasks;
                      using System.Windows;
                      using System.Windows.Input;
                      using System.Windows.Media;
                      using System.Xml.Serialization;
                      using NinjaTrader.Cbi;
                      using NinjaTrader.Gui;
                      using NinjaTrader.Gui.Chart;
                      using NinjaTrader.Gui.SuperDom;
                      using NinjaTrader.Data;
                      using NinjaTrader.NinjaScript;
                      using NinjaTrader.Core.FloatingPoint;
                      using NinjaTrader.NinjaScript.Indicators;
                      using NinjaTrader.NinjaScript.DrawingTools;
                      #endregion

                      //This namespace holds Strategies in this folder and is required. Do not change it.
                      namespace NinjaTrader.NinjaScript.Strategies
                      {
                      public class ntforumesignal : Strategy
                      {
                      protected override void OnStateChange()
                      {
                      if (State == State.SetDefaults)
                      {
                      Description = @"Enter the description for your new custom Strategy here.";
                      Name = "ntforumesignal";
                      Calculate = Calculate.OnBarClose;
                      EntriesPerDirection = 1;
                      EntryHandling = EntryHandling.AllEntries;
                      IsExitOnSessionCloseStrategy = true;
                      ExitOnSessionCloseSeconds = 30;
                      IsFillLimitOnTouch = false;
                      MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
                      OrderFillResolution = OrderFillResolution.Standard;
                      Slippage = 0;
                      StartBehavior = StartBehavior.AdoptAccountPosition;
                      TimeInForce = TimeInForce.Gtc;
                      TraceOrders = false;
                      RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
                      StopTargetHandling = StopTargetHandling.PerEntryExecution;
                      BarsRequiredToTrade = 20;
                      }
                      else if (State == State.Configure)
                      {
                      }
                      }

                      protected override void OnBarUpdate()
                      {
                      //Add your custom strategy logic here.
                      if (CrossAbove(Close,Open,1)) EnterLongStopLimit(Close[0]+1 * TickSize,Close[0]);
                      else if (CrossBelow(Close,Open,1)) EnterShortStopLimit(Close[0]-1 * TickSize,Close[0]);
                      }
                      }
                      }
                      and i've same problem....i don't see any signal..Historic





                      i use in a chart Es 03-16 (s&p fut) 1 minute...

                      i think 've problem about orderStopLimit

                      I open new thread in forum ? (i use a demo nt8 Continuum with cqg)
                      Last edited by esignal; 02-19-2016, 12:58 PM.

                      Comment


                        #26
                        Originally posted by esignal View Post
                        Ok..thanks you...

                        I try your script



                        and i've same problem....i don't see any signal..Historic





                        i use in a chart Es 03-16 (s&p fut) 1 minute...

                        i think 've problem about orderStopLimit

                        I open new thread in forum ? (i use a demo nt8 Continuum with cqg)
                        Have you enabled the chart to show trades?

                        Comment


                          #27
                          Yes...of course

                          Comment


                            #28
                            Originally posted by esignal View Post
                            Yes...of course
                            In that case, there is nothing that I can suggest. I have shown you the output of the code on my system. It clearly takes trades, albeit it is a losing system. If the exact same code does not work on your system, and there are no errors in your log, then there is no data that can suggest a solution.

                            Where did you ask it to show trades on the chart?

                            Comment


                              #29
                              Originally posted by koganam View Post
                              In that case, there is nothing that I can suggest. I have shown you the output of the code on my system. It clearly takes trades, albeit it is a losing system. If the exact same code does not work on your system, and there are no errors in your log, then there is no data that can suggest a solution.

                              Where did you ask it to show trades on the chart?
                              Where did you ask it to show trades on the chart?

                              What do you mean with " Where did you ask it to show trades on the chart? " ?

                              See that example :

                              With code :
                              Code:
                              	if (CrossAbove(Close,Open,1)) EnterLong(); 
                              			else if (CrossBelow(Close,Open,1)) EnterShort();
                              you see that pics :



                              It's ok!!

                              But if i code this :

                              Code:
                              		
                              		if (CrossAbove(Close,Open,1)) EnterLongStopLimit(Close[0]+1 * TickSize,Close[0]); 
                              			else if (CrossBelow(Close,Open,1)) EnterShortStopLimit(Close[0]-1 * TickSize,Close[0]);




                              I dont' see anything
                              Last edited by esignal; 02-20-2016, 09:35 AM.

                              Comment


                                #30
                                Originally posted by esignal View Post
                                Where did you ask it to show trades on the chart?

                                What do you mean with " Where did you ask it to show trades on the chart? " ?

                                See that example :

                                With code :
                                Code:
                                	if (CrossAbove(Close,Open,1)) EnterLong(); 
                                			else if (CrossBelow(Close,Open,1)) EnterShort();
                                you see that pics :



                                It's ok!!

                                But if i code this :

                                Code:
                                
                                




                                I dont' see anything
                                You have to explicitly enable the ability to see trades on the chart. You responded: "Of course" when I asked you if you had done so. Where did you do so?

                                Your asking me what I mean by the question means that you likely have not done so. Look in the properties of the DataSeries on your chart, and specify what to do with order display.

                                ref: http://ninjatrader.com/support/helpG...price_data.htm

                                Look especially at the third bullet point, and look at the last item in the picture.
                                Last edited by koganam; 02-20-2016, 09:19 AM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                669 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                378 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                111 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                575 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                580 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X