﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>RightEdge Forums / Trading / Order Execution  / Stop Loss bug (backtesting) / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>RightEdge Forums</description><link>http://www.rightedgesystems.com/forums/</link><webMaster>rightedge@yyesoftware.com</webMaster><lastBuildDate>Wed, 08 Feb 2012 16:04:47 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>[quote][b]gregoryj (2/28/2010)[/b][hr]Is the build available for testing?[/quote]&lt;br&gt;&lt;br&gt;Not yet, but I expect we will release it in a few days.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Daniel</description><pubDate>Mon, 01 Mar 2010 01:34:17 GMT</pubDate><dc:creator>dplaisted</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Is the build available for testing?</description><pubDate>Sun, 28 Feb 2010 18:17:52 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>I think I have figured out what the problem was.  When using CreateTicksFromBars=false, you should never have a position opening and closing on the same day.  What was happening is that if the order was filled on the bar's high, low, or close, the bar end time was being used as the fill time.  The bar end time of one bar is the same as the start time of the next bar, which meant these orders were showing up as being filled one bar later than they actually were.&lt;br&gt;&lt;br&gt;I've fixed this so the fill time will now be one second before the bar end time.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Daniel</description><pubDate>Sun, 28 Feb 2010 18:08:52 GMT</pubDate><dc:creator>dplaisted</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>anything new on this?</description><pubDate>Sun, 28 Feb 2010 11:40:45 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Excellent! It is so random, and I can't put my finger on it. Look forward to hear what you find.</description><pubDate>Wed, 24 Feb 2010 08:32:52 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Got it, investigating ...&lt;br&gt;&lt;br&gt;[quote][b]gregoryj (2/23/2010)[/b][hr]Bill, Not 6 trades in 1 day....rather 6 one day trades. Meaning the enter and exit were the same day.&lt;br&gt;In the output I sent you (i.e the CSV file which is within the RAR attached) &lt;br&gt;Do you not see the following 6 trades all occur on the same day?&lt;br&gt;ATHX	Long	500	1/7/2010 0:00	1/7/2010 0:00	3.7	3.75&lt;br&gt;ATHX	Long	500	1/22/2010 0:00	1/22/2010 0:00	2.9	3.03&lt;br&gt;ATHX	Long	500	1/27/2010 0:00	1/27/2010 0:00	2.51	2.58&lt;br&gt;ATHX	Long	500	1/28/2010 0:00	1/28/2010 0:00	2.55	2.64&lt;br&gt;ATHX	Long	500	1/29/2010 0:00	1/29/2010 0:00	2.46	2.61&lt;br&gt;ATHX	Long	500	2/12/2010 0:00	2/12/2010 0:00	3.24	3.31&lt;br&gt;&lt;br&gt;These are all produced by the same system I attached and could not have occured[/quote]</description><pubDate>Wed, 24 Feb 2010 08:08:14 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Bill, Not 6 trades in 1 day....rather 6 one day trades. Meaning the enter and exit were the same day.&lt;br&gt;In the output I sent you (i.e the CSV file which is within the RAR attached) &lt;br&gt;Do you not see the following 6 trades all occur on the same day?&lt;br&gt;ATHX	Long	500	1/7/2010 0:00	1/7/2010 0:00	3.7	3.75&lt;br&gt;ATHX	Long	500	1/22/2010 0:00	1/22/2010 0:00	2.9	3.03&lt;br&gt;ATHX	Long	500	1/27/2010 0:00	1/27/2010 0:00	2.51	2.58&lt;br&gt;ATHX	Long	500	1/28/2010 0:00	1/28/2010 0:00	2.55	2.64&lt;br&gt;ATHX	Long	500	1/29/2010 0:00	1/29/2010 0:00	2.46	2.61&lt;br&gt;ATHX	Long	500	2/12/2010 0:00	2/12/2010 0:00	3.24	3.31&lt;br&gt;&lt;br&gt;These are all produced by the same system I attached and could not have occured</description><pubDate>Tue, 23 Feb 2010 15:43:42 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>No, I'm not seeing 6 trades on one day, even in the output that you sent me.  It is set to relativeratio.  PT is 0.01, SL is 0.&lt;br&gt;&lt;br&gt;[quote][b]gregoryj (2/23/2010)[/b][hr]Bill, were you able to reporduce?[/quote]</description><pubDate>Tue, 23 Feb 2010 15:09:42 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Bill, were you able to reporduce?</description><pubDate>Tue, 23 Feb 2010 09:01:51 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Bill,&lt;br&gt;Can you confirm you set the profit target to Relative Ratio on the properties tab....see image&lt;br&gt;&lt;br&gt;http://screencast.com/t/Mjk0NmRlZ</description><pubDate>Mon, 22 Feb 2010 08:57:58 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Great!  I was able to import the system, run it with the data and get results, so we're on our way.  However, I'm not seeing the location where you say we have the same trade on 6 days.  Let's stay with the symbol ATHX and try to identify what you're seeing in error.  It's not immediately obvious to me.&lt;br&gt;&lt;br&gt;[quote][b]gregoryj (2/21/2010)[/b][hr]Here is another example using same system I attached before. I attached the entire project, so you should be able to just extract and import&lt;br&gt;&lt;br&gt;this time I use symbol [url=http://finance.yahoo.com/q/hp?a=&amp;b=&amp;c=&amp;d=1&amp;e=20&amp;f=2010&amp;g=d&amp;s=athx]ATHX[/url]&lt;br&gt;&lt;br&gt;YOu will see same day trades on 6 days.&lt;br&gt;The CSV is inside the .rar file along with the system.&lt;br&gt;&lt;br&gt;Also, take a look at the Trade List for these days. I think its a clue something is going wrong.[/quote]</description><pubDate>Mon, 22 Feb 2010 08:45:18 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Here is another example using same system I attached before. I attached the entire project, so you should be able to just extract and import&lt;br&gt;&lt;br&gt;this time I use symbol [url=http://finance.yahoo.com/q/hp?a=&amp;b=&amp;c=&amp;d=1&amp;e=20&amp;f=2010&amp;g=d&amp;s=athx]ATHX[/url]&lt;br&gt;&lt;br&gt;YOu will see same day trades on 6 days.&lt;br&gt;The CSV is inside the .rar file along with the system.&lt;br&gt;&lt;br&gt;Also, take a look at the Trade List for these days. I think its a clue something is going wrong.</description><pubDate>Sun, 21 Feb 2010 07:32:50 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>I also found a symbol that allows me to reproduce the bug.&lt;br&gt;&lt;br&gt;Please see my previous post for more info, but here is a simple script which will enter and exit same day with profit target set.&lt;br&gt;&lt;br&gt;Set the profit target to "RealtivePrice" .04 using the RightEdge Properties Panel.&lt;br&gt;Then use the attached .cs file for the code.&lt;br&gt;Run it against symbol [url=http://finance.yahoo.com/q/hp?s=TLLE.PK]TLLE[/url]&lt;br&gt;&lt;br&gt;You will see that on Jan 27th we enter @ .13 and exit on Jan 27th @ .23, this is impossible. CSV of trades attached as well.&lt;br&gt;&lt;br&gt;Please advise.&lt;br&gt;&lt;br&gt;</description><pubDate>Sat, 20 Feb 2010 17:35:22 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Something is seriously wrong with RightEdge Signals.&lt;br&gt;Here are all of the details. The interesting thing is Since beginning of the year I have several entries/exits generated. Some enter 1 day after the signal, others enter correctly on the day the signal is generated. Below are the details for one that enters on Signal +1 day.&lt;br&gt;&lt;br&gt;I have   SystemData.CreateTicksFromBars = false;&lt;br&gt;&lt;br&gt;Ticker Symbol : [url=http://finance.yahoo.com/q/hp?a=&amp;b=&amp;c=&amp;d=1&amp;e=20&amp;f=2010&amp;g=d&amp;s=clm]CLM[/url]&lt;br&gt;The [b]signal[/b] to open the order is  2/11/2010 12:00:00 AM&lt;br&gt;&lt;br&gt;The order was opened 2/12/2010 0:00 @ 11.12 which is impossible. As the prices for the day are&lt;br&gt;                  O              H              L              C               Vol          Adj Close&lt;br&gt;12-Feb-10	 10.87	10.89	10.11	10.41	107,000	  10.41&lt;br&gt;&lt;br&gt;&lt;br&gt;I use the following Code to generate the order&lt;br&gt;[code]&lt;br&gt;PositionSettings settings = new PositionSettings();&lt;br&gt;settings.PositionType = PositionType.Long;						&lt;br&gt;settings.OrderType = OrderType.Limit;&lt;br&gt;settings.LimitPrice = buyLimitPrice;					&lt;br&gt;settings.Size =  tradeSize;	&lt;br&gt;settings.ProfitTarget = longExit;&lt;br&gt;settings.ProfitTargetType = TargetPriceType.AbsolutePrice;&lt;br&gt;settings.Description = String.Format("signal date {0}",SystemData.CurrentDate);&lt;br&gt;OpenPosition(settings);	&lt;br&gt;[/code]&lt;br&gt;&lt;br&gt;I will follow up even more with details on faulty exits (i.e stop loss same day and Profit Target Same day) This is still occuring randomly in RE 2010 &lt;br&gt;</description><pubDate>Sat, 20 Feb 2010 13:07:36 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>acutally if you set Createticksfrombars = false...the problem goes away. Let me do some more work to reporduce problem</description><pubDate>Tue, 16 Feb 2010 18:30:04 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>here is an easy way to reproduce the bug. run this system against the nasdaq 100 from 1/1/2010 to now. Should profit target on same bar on wrong day. See attachment as well. This was my output&lt;br&gt;&lt;br&gt;[code]#region Using statements&lt;br&gt;using System;&lt;br&gt;using System.Drawing;&lt;br&gt;using System.Collections.Generic;&lt;br&gt;using RightEdge.Common;&lt;br&gt;using RightEdge.Common.ChartObjects;&lt;br&gt;using RightEdge.Indicators;&lt;br&gt;#endregion&lt;br&gt;&lt;br&gt;#region System class&lt;br&gt;public class MySystem : MySystemBase&lt;br&gt;{&lt;br&gt;	public override void Startup()&lt;br&gt;	{&lt;br&gt;		// Perform initialization or set system wide options here&lt;br&gt;&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;#endregion&lt;br&gt;&lt;br&gt;public class MySymbolScript : MySymbolScriptBase&lt;br&gt;{&lt;br&gt;	public override void Startup()&lt;br&gt;	{&lt;br&gt;		// Perform initialization here.&lt;br&gt;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public override void NewBar()&lt;br&gt;	{&lt;br&gt;		   PositionSettings settings = new PositionSettings();&lt;br&gt;		&lt;br&gt;						settings.PositionType = PositionType.Long;						&lt;br&gt;						settings.OrderType = OrderType.Limit;&lt;br&gt;						settings.LimitPrice = Bars.Current.Close - .1;					&lt;br&gt;						settings.Size =  500;										&lt;br&gt;						settings.ProfitTarget = .005;&lt;br&gt;						settings.ProfitTargetType = TargetPriceType.RelativeRatio;&lt;br&gt;						settings.BarCountExit = 2;&lt;br&gt;					//if (!PositionManager.GetOpenPositions(Symbol)) {&lt;br&gt;						OpenPosition(settings);&lt;br&gt;					//}	&lt;br&gt;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public override void OrderFilled(Position position, Trade trade)&lt;br&gt;	{&lt;br&gt;		// This method is called when an order is filled&lt;br&gt;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public override void OrderCancelled(Position position, Order order, string information)&lt;br&gt;	{&lt;br&gt;		// This method is called when an order is cancelled or rejected&lt;br&gt;&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;[/code]</description><pubDate>Tue, 16 Feb 2010 18:22:35 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Can you provide the following information?&lt;br&gt;&lt;br&gt;The date/time the order to open the position was submitted.&lt;br&gt;The date/time the open position order was filled, and at what price.&lt;br&gt;Whether the open position order was a market, limit, or stop order, and what the limit/stop price was.&lt;br&gt;&lt;br&gt;How was the stop loss order submitted?  Did you submit it yourself, use SetStopLoss, or did you have a stop loss specified in your system properties or when you called OpenPosition()?&lt;br&gt;&lt;br&gt;The date/time the stop loss order was submitted.&lt;br&gt;The stop price for the stop loss order.&lt;br&gt;The date/time the stop loss order was filled, and at what price.&lt;br&gt;&lt;br&gt;The open, high, low, close values for all bars between when the open position order was submitted and the stop loss order was filled.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Daniel</description><pubDate>Tue, 16 Feb 2010 11:52:13 GMT</pubDate><dc:creator>dplaisted</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>Does not appear to be fixed&lt;br&gt;I have a trade occuring on 1/14/2010 ticker symbol CTFO&lt;br&gt;Avg Entry 8.45, avg exit 9.5&lt;br&gt;&lt;br&gt;Price was never @ 8.45 on the 14th, but was on the 13th. Possible the bars are confused.&lt;br&gt;&lt;br&gt;Issue 2 is, my trades are entering and exiting on the same bar. So it buys on 1/14 and sells on 1/14. It can not make that determination based on the information it has.&lt;br&gt;&lt;br&gt;-Greg</description><pubDate>Mon, 15 Feb 2010 10:41:56 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>The issue where a trade could be outside of the bar's high/low range is supposed to be fixed in RE 2010 RC regardless of what you have CreateTicksFromBars set to.  Is this what you saw happening?  Can you give more information about what the prices were (for the bar, and for the order submitted).&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Daniel</description><pubDate>Sun, 14 Feb 2010 11:46:05 GMT</pubDate><dc:creator>dplaisted</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>I am using 2010, but seems like if I do the SystemData.CreateTicksFromBars = false&lt;br&gt;It fixes the problem</description><pubDate>Sun, 14 Feb 2010 07:31:37 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>This should be fixed in the latest version (RightEdge 2010 RC).  What version are you using?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Daniel</description><pubDate>Sat, 13 Feb 2010 20:39:39 GMT</pubDate><dc:creator>dplaisted</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>This is true of ProfitTarget as well...any update if there is a fix or work around.&lt;br&gt;I believe it is a tough thing to fix for backtests, seem you have to be able to set minimum number of bars</description><pubDate>Sat, 13 Feb 2010 15:00:01 GMT</pubDate><dc:creator>gregoryj</dc:creator></item><item><title>RE: Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>This problem has been previously reported and I understand it is being addressed.&lt;br&gt;&lt;br&gt;(My back test results are seriously affect by this, PL is grossly overstated.........)</description><pubDate>Thu, 04 Feb 2010 09:58:15 GMT</pubDate><dc:creator>smersh</dc:creator></item><item><title>Stop Loss bug (backtesting)</title><link>http://www.rightedgesystems.com/forums/Topic10687-11-1.aspx</link><description>in last beta version of RE positions could be closed at impossible prices outside of the bar, if system by mistake gives an order with stop loss favourable than the open or current price.&lt;br&gt;&lt;br&gt;(see attach)</description><pubDate>Thu, 04 Feb 2010 07:09:25 GMT</pubDate><dc:creator>lexx</dc:creator></item></channel></rss>
