RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



Profit Target, CreateTicksFromBars, and... Expand / Collapse
Message
Posted 12/28/2009 18:53:53 Post #10350
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
I like the CreateTicksFromBars feature that you have included in RE. I believe it will save me programming time by automatically accomplishing something that I manually had to implement before. However, I'm receiving strange trade results and need to get clarification on how the RE processes orders. I understand that if CreateTicksFromBars == true, then OHLC is processed in that order. Here are the basics of the system as implemented. Note that EnableTradeOnClose == true because I need to CloseAtMarket if certain conditions are hit. The issues relate to profit target though and Not CloseAtMarket execution but included this additional information in case it had an effect on what I'm seeing.

1. MySymbolScript.NewBar() processes next bar limit orders with a profit target set.
2. A BarOnClosing() implements conditional closes for the bar.

Here is an example of a profit target exit on the same bar that should not have occurred (profit target amount is irrelevant to the example):

1. OHLC is 13.27, 13.34, 12.75, and 12.78 respectfully
2. Buy limit == 13.09
3. Exit price == 13.35

That is, the buy could have not happened before the low of the bar and the only way to obviously obtain the exit price was to exit at the high. If high is processed before low, this trade would not have occurred.

Am I looking at the problem correctly or do I need to implement additional code?

Thanks, Duane

Posted 12/29/2009 00:59:00 Post #10354
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
Actually by default the low is processed before the high. I think that explains the result you saw. You can change it so that the high is processed first by right clicking on the root node of the project tree, clicking properties, clicking on the Simulation tab, and enabling the "Analyze High Before Low" option.

Thanks,
Daniel
« Prev Topic | Next Topic »


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

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 1:03am

2005-2007 © RightEdge Systems