NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 06-27-2012, 05:10 PM   #1
relogical
Member
 
Join Date: Jun 2012
Posts: 87
Thanks: 3
Thanked 1 time in 1 post
Default Renko problems

I have created a simple strategy that uses Renko bars. The problem is that sometimes my trades are entered exactly where I specified and sometimes they are completely wrong. In history performance everything looks perfect but when testing in reply it's hit and miss. Why is this?

Here's my code:
Code:
        protected override void Initialize()
        {
            SetProfitTarget("", CalculationMode.Ticks, ProfitTarget);
            SetStopLoss("", CalculationMode.Ticks, StopLoss, false);

            CalculateOnBarClose = true;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {


            // Condition set 1
            if (ToTime(Time[0]) > ToTime(8, 30, 0)
                && ToTime(Time[0]) < ToTime(14, 55, 0)
                && Position.MarketPosition == MarketPosition.Flat
                && CrossAbove(DMplus(ADXPeriod).DiPlus, DMplus(ADXPeriod).DiMinus, 1))
            {
                EnterLong(DefaultQuantity, "");
            }


            // Condition set 2
            if (CrossBelow(DMplus(ADXPeriod).DiMinus, DMplus(ADXPeriod).DiPlus, 1))
            {
                ExitLong("", "");
            }
        }
Attached Images
File Type: jpg renko.jpg (376.7 KB, 32 views)
Last edited by relogical; 06-27-2012 at 06:02 PM.
relogical is offline  
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Renko tonynt Automated Trading 8 08-25-2011 12:44 PM
Renko in 6.5 shali27 Charting 1 05-12-2010 09:15 AM
Renko Help kermut Strategy Analyzer 5 08-15-2009 04:17 PM
Connection Problems followed by NT Strategy Problems GerTrader Connecting 21 05-20-2009 01:29 PM
Log File problems and Live Trade Problems gygraham Connecting 7 03-30-2008 05:16 PM


All times are GMT -6. The time now is 09:25 PM.