RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        


123»»»

Stop Loss bug (backtesting) Expand / Collapse
Message
Posted 2/4/2010 07:09:25 Post #10687
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
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.

(see attach)

  Post Attachments 
SL.GIF (27 views, 4.50 KB)
Posted 2/4/2010 09:58:15 Post #10688
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
This problem has been previously reported and I understand it is being addressed.

(My back test results are seriously affect by this, PL is grossly overstated.........)
Posted 2/13/2010 15:00:01 Post #10854
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
This is true of ProfitTarget as well...any update if there is a fix or work around.
I believe it is a tough thing to fix for backtests, seem you have to be able to set minimum number of bars
Posted 2/13/2010 20:39:39 Post #10857
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
This should be fixed in the latest version (RightEdge 2010 RC). What version are you using?

Thanks,
Daniel
Posted 2/14/2010 07:31:37 Post #10867
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
I am using 2010, but seems like if I do the SystemData.CreateTicksFromBars = false
It fixes the problem
Posted 2/14/2010 11:46:05 Post #10870
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
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).

Thanks,
Daniel
Posted 2/15/2010 10:41:56 Post #10874
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
Does not appear to be fixed
I have a trade occuring on 1/14/2010 ticker symbol CTFO
Avg Entry 8.45, avg exit 9.5

Price was never @ 8.45 on the 14th, but was on the 13th. Possible the bars are confused.

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.

-Greg
Posted 2/16/2010 11:52:13 Post #10886
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
Can you provide the following information?

The date/time the order to open the position was submitted.
The date/time the open position order was filled, and at what price.
Whether the open position order was a market, limit, or stop order, and what the limit/stop price was.

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()?

The date/time the stop loss order was submitted.
The stop price for the stop loss order.
The date/time the stop loss order was filled, and at what price.

The open, high, low, close values for all bars between when the open position order was submitted and the stop loss order was filled.

Thanks,
Daniel
Posted 2/16/2010 18:22:35 Post #10888
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
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

#region Using statements
using System;
using System.Drawing;
using System.Collections.Generic;
using RightEdge.Common;
using RightEdge.Common.ChartObjects;
using RightEdge.Indicators;
#endregion

#region System class
public class MySystem : MySystemBase
{
public override void Startup()
{
// Perform initialization or set system wide options here

}
}
#endregion

public class MySymbolScript : MySymbolScriptBase
{
public override void Startup()
{
// Perform initialization here.

}

public override void NewBar()
{
PositionSettings settings = new PositionSettings();

settings.PositionType = PositionType.Long;
settings.OrderType = OrderType.Limit;
settings.LimitPrice = Bars.Current.Close - .1;
settings.Size = 500;
settings.ProfitTarget = .005;
settings.ProfitTargetType = TargetPriceType.RelativeRatio;
settings.BarCountExit = 2;
//if (!PositionManager.GetOpenPositions(Symbol)) {
OpenPosition(settings);
//}

}

public override void OrderFilled(Position position, Trade trade)
{
// This method is called when an order is filled

}

public override void OrderCancelled(Position position, Order order, string information)
{
// This method is called when an order is cancelled or rejected

}
}


  Post Attachments 
BadResults.zip (2 views, 1.05 KB)
Posted 2/16/2010 18:30:04 Post #10889
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
acutally if you set Createticksfrombars = false...the problem goes away. Let me do some more work to reporduce problem
« Prev Topic | Next Topic »

123»»»

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 7:49am

2005-2007 © RightEdge Systems