﻿<?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 / Trading Systems </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>Sun, 07 Sep 2008 16:29:56 GMT</lastBuildDate><ttl>20</ttl><item><title>EOD calculation</title><link>http://www.rightedgesystems.com/forums/Topic6390-9-1.aspx</link><description>When working with intraday bars, is it possible to know that a bar is the last bar of the market day before the next bar comes with a new date?&lt;br&gt;The idea is that I will be able to run calculations at the end of the day and stage orders for the opening of the next business day.&lt;br&gt;&lt;br&gt;</description><pubDate>Tue, 19 Aug 2008 00:27:14 GMT</pubDate><dc:creator>lksf</dc:creator></item><item><title>How do you send an order?</title><link>http://www.rightedgesystems.com/forums/Topic6454-9-1.aspx</link><description>I am looking through the docs but there doesn't seem to be any tutorial. How do you just send out an order or open up a position?&lt;br&gt;&lt;br&gt;Thx.</description><pubDate>Thu, 28 Aug 2008 00:57:26 GMT</pubDate><dc:creator>snackly</dc:creator></item><item><title>Is it possible to get a simple Volume indicator, with no fancy functions, just a plot of the volume?</title><link>http://www.rightedgesystems.com/forums/Topic6456-9-1.aspx</link><description>I am looking to just be able to get the dataseries for the volume, without any averaging or any fancy stuff done to it like it seems to be the case in the Volume indicators. Does this exist by default somewhere?&lt;br&gt;&lt;br&gt;Thx.</description><pubDate>Thu, 28 Aug 2008 01:17:05 GMT</pubDate><dc:creator>snackly</dc:creator></item><item><title>Enter on Daily data, Exit on Intraday</title><link>http://www.rightedgesystems.com/forums/Topic6321-9-1.aspx</link><description>I have 30min Bars and I'm interested in creating rules for opening positions based on Daily information&lt;br&gt;(OHLC, Volume, EMA and more) but use the 30min info to exit my position.&lt;br&gt;&lt;br&gt;Is there an easy way to do that?&lt;br&gt;Before testing out RightEdge I've been using WealthLabPro from Fidelity, they have a "SetScaleDaily()" method and "RestoreScale()" which will make the code in between them run as if the interval is Daily, so Bar-1 is yesterday and EMA(50) is 50day MA and not 50"30MinBars" MA.&lt;br&gt;&lt;br&gt;Thanks</description><pubDate>Thu, 07 Aug 2008 19:57:28 GMT</pubDate><dc:creator>lksf</dc:creator></item><item><title>Develope a system that goes short on spikes</title><link>http://www.rightedgesystems.com/forums/Topic6102-9-1.aspx</link><description>Hi &lt;P&gt;I am new to Rightedge and C# coding. I am trying to develop a system that goes short when the price is higher than a predefined value. Once the price goes down by x % I want to take profit and the new value that the price needs to exceed is the previous profit taking price. This is a short selling strategy which I think could be profitable in current market conditions.&lt;/P&gt;&lt;P&gt;Any help in coding this in C# would be greatly appreciated as well as comments/remarks about this strategy.</description><pubDate>Tue, 08 Jul 2008 11:07:38 GMT</pubDate><dc:creator>agragr</dc:creator></item><item><title>Export Performance Analysis to external storage</title><link>http://www.rightedgesystems.com/forums/Topic5851-9-1.aspx</link><description>Hi,&lt;br&gt;&lt;br&gt;Upon we backtest the trading system, we get the performance analysis figures such as MAE, MFE, win%, lose% .... etc&lt;br&gt;&lt;br&gt;I would like to know whether it is possible to output these analysis figures to external storage (e.g. output to SQL server, access database, plaint text file )  ?&lt;br&gt;&lt;br&gt;Also, is it possible to define custom analysis figures (for example, other than Sharpe ratio, I would like to add sortino ratio for my trading system analysis purpose) ?&lt;br&gt;&lt;br&gt;</description><pubDate>Tue, 03 Jun 2008 07:33:20 GMT</pubDate><dc:creator>rgrg</dc:creator></item><item><title>Fill order on signal generation bar or Next Bar ?</title><link>http://www.rightedgesystems.com/forums/Topic5830-9-1.aspx</link><description>Hi,&lt;br&gt;&lt;br&gt;&lt;br&gt;I would like to know whether following is possible in RE:&lt;br&gt;For backtesting daily data,  Is it possible to fill the order immediate on signal generation bar ?&lt;br&gt;(for example, if signal generate on 2008-May-29, would the order fill on 2008-May-29 or 2008-May-30 ?)&lt;br&gt;&lt;br&gt;OR is it possible to setup the fill type either&lt;br&gt;1) to fill the order immediately at the market close of 2008-May-29&lt;br&gt;2) to fill the order immediately at the market open of 2008-May-30&lt;br&gt;&lt;br&gt;Please kindly advice. thanks !&lt;br&gt;</description><pubDate>Sat, 31 May 2008 08:18:14 GMT</pubDate><dc:creator>rgrg</dc:creator></item><item><title>results for the same symbols different if simulating less symbols</title><link>http://www.rightedgesystems.com/forums/Topic5829-9-1.aspx</link><description>never mind....&lt;P&gt;Walt</description><pubDate>Sat, 31 May 2008 08:09:13 GMT</pubDate><dc:creator>hairy_mug</dc:creator></item><item><title>composite calculations?</title><link>http://www.rightedgesystems.com/forums/Topic5771-9-1.aspx</link><description>If I am looking at 10 symbols and want to pick the one with the highest RSI (for example),&lt;/P&gt;&lt;P&gt;Basicly, how would I do this since the system is centered on one symbol at a time?&lt;/P&gt;&lt;P&gt;Thanks for any ideas...&lt;/P&gt;&lt;P&gt;walt </description><pubDate>Fri, 23 May 2008 21:50:27 GMT</pubDate><dc:creator>hairy_mug</dc:creator></item><item><title>Entering/Exiting positions based on slope of MA</title><link>http://www.rightedgesystems.com/forums/Topic5719-9-1.aspx</link><description>I searched the forums and user manual and didn't see how to do this (I also didn't see a "slope" option in any system components).&lt;br&gt;&lt;br&gt;How do I use the drag-and-drop menu to code an entry when a certain MA slopes up (and exit when the slope changes to "down")?&lt;br&gt;&lt;br&gt;Thanks.</description><pubDate>Wed, 21 May 2008 12:17:24 GMT</pubDate><dc:creator>metalhead</dc:creator></item><item><title>Partial Fills and SetProfitTarget</title><link>http://www.rightedgesystems.com/forums/Topic5617-9-1.aspx</link><description>I seem to be getting and additional phantom order sent to TWS on partial fills.&lt;P&gt;Suppose I open a long position 2 Lots YM and I set the profit target to x%.&lt;/P&gt;&lt;P&gt;Upon buying the position, RE will place the profit tgt order to sell.&lt;/P&gt;&lt;P&gt;When I get a partial fill, 1 out of 2, another order to sell 1 is being fired to TWS. leaving the total orders to sell to 2 (even though 1 has already been filled for a net position of -1 (short).&lt;/P&gt;&lt;P&gt;It seems that a profittarget order for some reason always cancels the existing order (upon a fill) and resends the same order with the remaining size. However, the cancel order portion doesn't always show up in TWS effectively leaving the original order and a new one.&lt;/P&gt;&lt;P&gt;Its been about a week debugging this and I've managed to remove all order entries on orderfilled and anywhere else. I only send the order once (bars valid = -1) so I don't think its on my end...&lt;/P&gt;&lt;P&gt;What's going on?&lt;/P&gt;&lt;P&gt;thx&lt;P&gt; &lt;P&gt;p.s. Of course the problem doesn't exist when trading 1 lot (no partial fills) but is compounded when trading 100 lots.</description><pubDate>Tue, 13 May 2008 12:17:42 GMT</pubDate><dc:creator>DoQ</dc:creator></item><item><title>indicator values for the active bar</title><link>http://www.rightedgesystems.com/forums/Topic5256-9-1.aspx</link><description>The indicators I have setup determine the values for the active bar based only on previous values. These indicators are a mix of IndicatorBase, and SeriesCalculatorBaseWithValues base types. In order to analyze these indicators in the context of current market activity I need to be able to access the values during the formation of a new bar.&lt;br&gt;&lt;br&gt;It seems that simulations and live systems handle this differently, which I assume is because the paper broker doesn't yet handle ticks. I hope that when the paper broker implements tick level processing these interfaces will converge. Having separate logic for live vs. backtest modes is always more work to implement, and potentially dangerous.&lt;br&gt;&lt;br&gt;For now, I've been testing using the BarOpened event and the paper broker. It seems that the BarData passed to the event handler is not in the Bars list, and thus the indicator values have not yet been calculated. I would presume that the NewTick() partialBar is in a similar state when running a system live.&lt;br&gt;&lt;br&gt;So, how can I access my indicator values for the "real" current bar, not the last completed?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Mark</description><pubDate>Sat, 05 Apr 2008 19:38:34 GMT</pubDate><dc:creator>mark0419</dc:creator></item><item><title>Optimize (as in speed up) backtest</title><link>http://www.rightedgesystems.com/forums/Topic4916-9-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Hello and thanks for your input in advance. I’ve been playing with RE for the last couple of weeks, put a system together and tried to optimize the parameters. Everything worked as expected except that it took an extremely long time to run, in my opinion at least. I had three parameter with a total of 500 iterations over 1 minute data from &lt;/SPAN&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:date Day="1" Month="1" Year="2008"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;1/1/2008&lt;/SPAN&gt;&lt;/st1:date&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; to &lt;/SPAN&gt;&lt;st1:date Day="10" Month="3" Year="2008"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;3/10/2008&lt;/SPAN&gt;&lt;/st1:date&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;. I realize that at a 1 minute interval that’s a good number of data points but then again it’s only two months or so. Not very long by backtesting standards. All of this is running on a dual 3 GHz Zeon box with 5GB or ram so that should not be the issue. In fact the CPU maxed around 55% to 60% and 2 GB or so of RAM being used, 0.8 GB for RE. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;So my question is whether this is typical and if so what are some ways to speed this up? Using Trade Station some years back I could backtest tens of thousands of iterations on 5 minute data in a day or so. I expected RE to be faster since it was compiled and not a script. This is a very basic strategy with one moving average and two momentum indicators. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;Thanks&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;FONT color=#000000&gt;Doug&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;</description><pubDate>Mon, 17 Mar 2008 14:49:32 GMT</pubDate><dc:creator>dpeck</dc:creator></item><item><title>System Results in Charts</title><link>http://www.rightedgesystems.com/forums/Topic4974-9-1.aspx</link><description>How can I display simulation results after a backtest in charts (Entry, Exit). Do I have to implement that in the code or is there an easier way ?&lt;/P&gt;&lt;P&gt;Thanks for your help</description><pubDate>Thu, 20 Mar 2008 07:05:40 GMT</pubDate><dc:creator>gtomez</dc:creator></item><item><title>Trading YM while watching #YM</title><link>http://www.rightedgesystems.com/forums/Topic4922-9-1.aspx</link><description>What would be the easiest and simplest way to trade YM via IB but running all logic on #YM data thru OpenTick. It doesn't seem as simple as passing a different symbol object to OpenPosition...&lt;P&gt;Ideally I would select only #YM from my watchlist, generate buys and sells and pass the IBSymbol object to OpenPosition. Maybe a wrapper at the broker level that changes the symbol name to and from?&lt;/P&gt;&lt;P&gt;thx&lt;P&gt;Edit: using RE1.1</description><pubDate>Mon, 17 Mar 2008 22:28:44 GMT</pubDate><dc:creator>DoQ</dc:creator></item><item><title>Null reference exception on GAIN service for forex</title><link>http://www.rightedgesystems.com/forums/Topic4804-9-1.aspx</link><description>[url=http://farm4.static.flickr.com/3213/2319455579_43487025a4_o.png]http://farm4.static.flickr.com/3213/2319455579_43487025a4_o.png[/url]&lt;br&gt;&lt;br&gt;hi,&lt;br&gt;&lt;br&gt;Getting a null reference error when trying to set GAIN as a service for forex data... any ideas on this one? Thanks&lt;br&gt;&lt;br&gt;&lt;br&gt;</description><pubDate>Sat, 08 Mar 2008 22:08:37 GMT</pubDate><dc:creator>heliosphan</dc:creator></item><item><title>Using one symbol on multiple timeframes?</title><link>http://www.rightedgesystems.com/forums/Topic4228-9-1.aspx</link><description>I need to implement a system using multiple time frames (30 min, 1 hour and daily) of one forex symbol (EUR/USD)&lt;br&gt;&lt;br&gt;To get the data it was necessary to create 3 folders for the frequencies and to define the same symbol 3 times(?!?!)&lt;br&gt;&lt;br&gt;However how can I distinguish in the system which series of bars for which frequency (time frame) belongs?&lt;br&gt;The systems runs on new bar of the lowest time frame only.&lt;br&gt;&lt;br&gt;Can you point me to some tutorial or example?&lt;br&gt;thanks</description><pubDate>Mon, 07 Jan 2008 12:13:11 GMT</pubDate><dc:creator>greg</dc:creator></item><item><title>Custom Loading of Historical Data</title><link>http://www.rightedgesystems.com/forums/Topic4672-9-1.aspx</link><description>I am trying to see if I am able to load data to do some processing outside of RightEdge and the normal backtesting framework... I am still going to use backtesting, but I have a few things I need to do with market data...&lt;br&gt;&lt;br&gt;So far it looks like I can, but I haven't figured out what to use for frequency (my data is saved in 1 min bars [hopefully]).  I can't find anything in the API docs to indicate what are proper values for frequency.  Not sure if it would be milliseconds or minutes or ???....   I am able to access the BinaryDataStore though, just never get anything back from LoadBars so far...  Figuring I am just off somewhere in my setup of the SymbolFreq to use in LoadBars...&lt;br&gt;&lt;br&gt;Thoughts?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Chris&lt;br&gt;&lt;br&gt;&lt;br&gt;</description><pubDate>Sun, 24 Feb 2008 15:19:56 GMT</pubDate><dc:creator>chrisa23</dc:creator></item><item><title>BarAggregator.AggregateBars syntax question</title><link>http://www.rightedgesystems.com/forums/Topic4638-9-1.aspx</link><description>&lt;FONT face=Arial size=2&gt;&lt;P&gt;I downloaded the BarAggregator system in C#, but it was more of an example of how to export agreggated bars to a file.  I was hoping to see a simple system example in VB.Net and I think it would help several of us.  I now have very good data from OpenTick.  It does include the extended periods of data, but I wrote several scripts to clean this data daily.  This is basically my last hurdle to test a lot of my systems quickly.  I'm collecting 1 minute bars and would like to run my systems on 3, 5, 10, 30 and 60 intervals for the same symbol. &lt;/P&gt;&lt;P&gt;So, regarding Aggregating bars I have several questions&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;1. When writing a system, where is the best place in the code to aggregate the bars?  I'm trying to do it in the &lt;FONT face=Arial size=2&gt;NewSymbolBar sub.  Remember, I'm trying to plot indicators and open positions based on aggregated bar data. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;2. Do I need to collect the 1 minute bars first with the following statement:&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; bars &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; List(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; BarData) = SystemData.SystemBars(symbol)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and then aggregate the these bars to a different frequency?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P dir=ltr&gt;I'll start there... my code looks something like the below example but the syntax is not correct.  &lt;STRONG&gt;Can you correct it for me?&lt;/STRONG&gt;&lt;/P&gt;&lt;P dir=ltr&gt;I only need a little direction and I'll be off and running.  Thanks&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Get the collection of bars for the current symbol &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; bars &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; List(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; BarData) = SystemData.SystemBars(symbol)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;'List&amp;lt;BarData&amp;gt; weeklyBars = BarAggregator.AggregateBars(cleanedBars, (int) BarFrequency.Weekly);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; Sixtybars &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; List(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; BarData) = BarAggregator.AggregateBars(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; bars &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; List(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; BarData), &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; BarFrequency.SixtyMinute &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Integer&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 21 Feb 2008 13:04:07 GMT</pubDate><dc:creator>RJ</dc:creator></item><item><title>A simple trading system</title><link>http://www.rightedgesystems.com/forums/Topic7-9-1.aspx</link><description>Here's a simple band violation system using 200 period Widner bands.  The system goes long on a lower band penetration.  The profit target is 5% with a 50 bar timeout.&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;using System;&lt;BR&gt;using System.Drawing;&lt;BR&gt;using System.Windows.Forms;&lt;BR&gt;using System.Collections.Generic;&lt;BR&gt;using RightEdge.Common;&lt;BR&gt;using Indicators;&lt;/P&gt;&lt;P&gt;namespace System2005&lt;BR&gt;{&lt;BR&gt;    /// &amp;lt;summary&amp;gt;&lt;BR&gt;    /// Summary description for ScriptMain&lt;BR&gt;    /// &amp;lt;/summary&amp;gt;&lt;BR&gt;    public class ScriptMain : IScript&lt;BR&gt;    {&lt;BR&gt;        private Dictionary&amp;lt;string, List&amp;lt;double&amp;gt;&amp;gt; widnerLowerValues = new Dictionary&amp;lt;string, List&amp;lt;double&amp;gt;&amp;gt;();&lt;/P&gt;&lt;P&gt;        public void Main(TradingInfo info)&lt;BR&gt;        {&lt;BR&gt;            try&lt;BR&gt;            {&lt;BR&gt;                BuildIndicators(info);&lt;BR&gt;                // Here is your profit target value&lt;BR&gt;                info.TradingSystem.ProfitTarget = 5.0;&lt;BR&gt;                // Here is your time out exit value.&lt;BR&gt;                // Change this to 0 for no time-out&lt;BR&gt;                info.TradingSystem.BarCountExit = 50;&lt;/P&gt;&lt;P&gt;            }&lt;BR&gt;            catch(Exception exception)&lt;BR&gt;            {&lt;BR&gt;                if (!(exception is System.Threading.ThreadAbortException))&lt;BR&gt;                {&lt;BR&gt;                    // Handle trading system exceptions here&lt;BR&gt;                    MessageBox.Show(exception.Message + "\r" + exception.StackTrace);&lt;BR&gt;                }&lt;BR&gt;            }&lt;BR&gt;            &lt;BR&gt;        }&lt;/P&gt;&lt;P&gt;        public void BuildIndicators(TradingInfo info)&lt;BR&gt;        {&lt;BR&gt;            // First go through each symbol, build &amp;amp; plot the indicators&lt;BR&gt;            foreach(string symbol in info.ChartPaneCollections.Keys)&lt;BR&gt;            {&lt;BR&gt;                List&amp;lt;ChartPane&amp;gt; panes = info.ChartPaneCollections[symbol];&lt;BR&gt;                List&amp;lt;BarData&amp;gt; bars = info.BarCollections[symbol];&lt;BR&gt;                ChartPane pricePane = panes[0];&lt;BR&gt;                WidnerLowerBand widnerLowerBand = new WidnerLowerBand(200);&lt;BR&gt;                List&amp;lt;double&amp;gt;bblValues = widnerLowerBand.GetSeries(bars);&lt;BR&gt;                widnerLowerValues.Add(symbol, bblValues);&lt;BR&gt;                pricePane.PlotSeries(bblValues, "Lower Widner", Color.Red);&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;        &lt;BR&gt;        public void Trade(TradingInfo info, int index)&lt;BR&gt;        {&lt;BR&gt;            foreach(string symbol in info.BarCollections.Keys)&lt;BR&gt;            {&lt;BR&gt;                List&amp;lt;BarData&amp;gt; bars = info.BarCollections[symbol];&lt;BR&gt;                List&amp;lt;double&amp;gt;bblValues = widnerLowerValues[symbol];&lt;BR&gt;                BarData bar = bars[index];&lt;BR&gt;                SymbolInformation symbolInfo = info.GetSymbolInformation(symbol);&lt;BR&gt;                info.TradingSystem.EvaluatePositions(symbolInfo, index);&lt;/P&gt;&lt;P&gt;                if (!bar.EmptyBar)&lt;BR&gt;                {&lt;BR&gt;                    double limitPrice = bblValues[index];&lt;BR&gt;                    info.TradingSystem.OpenPosition(symbolInfo, index + 1, PositionType.Long, OrderType.Limit, limitPrice);&lt;BR&gt;                }&lt;BR&gt;            }&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;}&lt;BR&gt;[/code]</description><pubDate>Thu, 22 Dec 2005 09:54:47 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>How to Backtest Options Strategies</title><link>http://www.rightedgesystems.com/forums/Topic4455-9-1.aspx</link><description>I am interested in backtesting a trading system.  I want to start with a real simple set of entries and exits, say just on stocks to keep it very simple--no commodities or forex just yet.  The problem is, I don't buy stocks, I buy call spreads to get long, and put spreads to get short.  If I used Tradestation/Metastock/etc. to test a system that bought and sold STOCKS based on simple entry and exit rules, that'd be pretty straightforward.  My question is, what trade simulator software would be best for testing those same rules but buying spreads instead of the stocks themselves?  I'm sure lots of folks here use bull call spreads and bear put spreads, does anybody have a tested system that uses these  options strategies with simple entry and exit rules?</description><pubDate>Sun, 27 Jan 2008 00:17:59 GMT</pubDate><dc:creator>dspicer527</dc:creator></item><item><title>My first trading system to share for those who like to add, use or modify the code</title><link>http://www.rightedgesystems.com/forums/Topic4354-9-1.aspx</link><description>&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; System;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; System.Drawing;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; System.Drawing.Text;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; System.Windows.Forms;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; System.Data;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; System.Media;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; System.Collections.Generic;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; RightEdge.Common;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; RightEdge.Common.ChartObjects;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; RightEdge.Indicators;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; SystemMain : SystemBase{ &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;SoundPlayer simpleSound = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; SoundPlayer(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;@"h:\Windows\Media\Windows XP starten.wav"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;static&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; buypow;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ctext; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Text for chart.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; buyreserve = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0.0&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;DateTime exchangeOpen = Convert.ToDateTime(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"15:30:10 pm"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;); &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;DateTime exchangeClosed = Convert.ToDateTime(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"21:59:50 pm"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;); &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;TimeSpan thisTime = DateTime.Now.TimeOfDay; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// This date (time 00:00:00)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;override&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; Startup(){&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].CreateIndicator(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; SMA(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;3&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;));&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma1"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].CreateIndicator(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; SMA(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;12&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;));&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].CreateIndicator(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; RelativeStrength(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;14&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;));&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBU"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].CreateIndicator(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; BollingerBandUpper(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;14&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1.5&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;));&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBL"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].CreateIndicator(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; BollingerBandLower(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;14&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1.5&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;));&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SetInputs(BarElement.Close);&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma1"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SetInputs(BarElement.Close);&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SetInputs(BarElement.Close);&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBU"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SetInputs(BarElement.Close);&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBL"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SetInputs(BarElement.Close);&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SeriesColor = Color.LightGreen;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma1"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SeriesColor = Color.Yellow;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SeriesColor = Color.GreenYellow;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBU"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SeriesColor = Color.Crimson;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBL"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].SeriesColor = Color.Cornsilk;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].LineSize = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;2&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBU"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].LineSize = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;2&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].ChartPaneName=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI indicator"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBU"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].ChartPaneName =&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Price Pane"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBL"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].ChartPaneName =&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Price Pane"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].AddToCharts();&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma1"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].AddToCharts();&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].AddToCharts();&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBU"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].AddToCharts();&lt;/P&gt;&lt;P&gt;Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBL"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;].AddToCharts();&lt;/P&gt;&lt;P&gt;buypow = SystemData.SystemStatistics.CurStat.BuyingPower;&lt;/P&gt;&lt;P&gt;PositionManager.OrderFilled += &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; EventHandler&amp;lt;OrderFilledEventArgs&amp;gt;(OrderFilled);&lt;/P&gt;&lt;P&gt;PositionManager.OrderUpdated += &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; PositionManager.PositionOrderUpdatedDelegate(OrderStatus);&lt;/P&gt;&lt;P&gt;PositionManager.PositionTimeOut = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;SystemData.Output.OutputLines.Clear();&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;override&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; NewSymbolBar(Symbol symbol, BarData bar){&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; BuyLong=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; SellLong=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;; &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; Trailingstop = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0.0&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; StopLoss = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0.0&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;DateTime point = bar.PriceDateTime;&lt;/P&gt;&lt;P&gt;List&amp;lt;Position&amp;gt; myPositions=PositionManager.GetOpenPositions(symbol);&lt;/P&gt;&lt;P&gt;ISeries sma3 = Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;][symbol];&lt;/P&gt;&lt;P&gt;ISeries sma12 = Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"sma1"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;][symbol];&lt;/P&gt;&lt;P&gt;ISeries highpass = Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBU"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;][symbol]; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Statistically high.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ISeries lowpass = Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BBL"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;][symbol]; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Statistically low.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ISeries rsi = Indicators[&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"RSI"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;][symbol]; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// RSI&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;IList&amp;lt;BarData&amp;gt; bars = SystemData.SymbolBars[symbol]; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Bar list for this symbol.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ISeries barOpen = SystemData.GetBarElementSeries(symbol, BarElement.Open, &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;ISeries barClose = SystemData.GetBarElementSeries(symbol, BarElement.Close, &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;ISeries barHigh = SystemData.GetBarElementSeries(symbol, BarElement.High, &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;ISeries barLow = SystemData.GetBarElementSeries(symbol, BarElement.Low, &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//double barserieHigh = BarUtils.HighestHigh(bars,-1,5); &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossOv = SystemUtils.CrossOver(sma3, sma12);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossUn = SystemUtils.CrossUnder(sma3, sma12);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossPup = SystemUtils.CrossOver(barHigh, sma3);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossPdown = SystemUtils.CrossUnder(barLow, sma3);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossBarPup = SystemUtils.CrossOver(barClose, highpass);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossBarPdown = SystemUtils.CrossUnder(barClose, lowpass);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossLowPassup = SystemUtils.CrossOver(sma3, lowpass);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossHighPassdown = SystemUtils.CrossUnder(sma3, highpass);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; CrossHighPassup = SystemUtils.CrossOver(sma3, highpass);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if(bar.PriceDateTime&amp;gt;exchangeClosed){&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if(!(point.TimeOfDay == TimeSpan.Parse("21:50:00"))){&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(bar.PriceDateTime&amp;gt;exchangeClosed){&lt;/P&gt;&lt;P&gt;List&amp;lt;Position&amp;gt; openPositions = PositionManager.GetOpenPositions();&lt;/P&gt;&lt;P&gt;PositionManager.CloseAllPositions();&lt;/P&gt;&lt;P&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"All Positions CLosed Exchange Closed manager {0}"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,exchangeClosed);}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(barHigh.Count&amp;gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;4&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;){&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Console.WriteLine("BARHIGH "+bars[barHigh.Count-3].High+ symbol);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(bars.Count&amp;gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;5&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;){ &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; barserieHigh = BarUtils.HighestHigh(bars,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;3&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;); &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; barserieLow = BarUtils.LowestLow(bars,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;4&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;2&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;); &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (CrossPup) {BuyLong+=1;} &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (CrossOv) {BuyLong+=2;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; (CrossBarPdown) {BuyLong+=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (bar.Low&amp;gt;bars[bars.Count-2].Low &amp;amp;&amp;amp; bar.High &amp;gt; bars[bars.Count-3].High) { BuyLong+=2;}//12&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (CrossBarPdown) {BuyLong+=4;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if(bar.Low&amp;lt;lowpass[lowpass.Count-1]) {BuyLong+=3;} &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if(bar.Close&amp;lt;lowpass[lowpass.Count-1]) {BuyLong+=5;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if((highpass[highpass.Count-1]-lowpass[lowpass.Count-1])&amp;lt;(bar.High-bar.Low)) {BuyLong-=6;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (bars[barHigh.Count-25].High&amp;lt;bar.High) {Long+=1;} &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Console.WriteLine("Barserie Hoog {0}",barserieHigh);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (CrossHighPassdown) {SellLong+=1;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (bar.High &amp;lt; bars[bars.Count-3].High) {SellLong+=2;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; (CrossBarPup) {SellLong+=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (CrossBarPup) {SellLong+=4;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (rsi[rsi.Count-1] &amp;gt; 80) {SellLong+=1;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (CrossPdown) {SellLong+=2;} &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (CrossUn) {SellLong+=4;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (bars[barHigh.Count-25].High&amp;lt;bar.High) {Short+=1;} &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (bar.Low&amp;lt;bars[bars.Count-2].Low &amp;amp;&amp;amp; bar.High &amp;lt; bars[bars.Count-3].High) { SellLong+=4;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (rsi[rsi.Count-1] &amp;lt; 65) {SellLong+=1;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if(bar.High&amp;gt;highpass[highpass.Count-1]) {SellLong+=5;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if (bar.High&amp;lt;=barserieHigh) {SellLong+=5;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if(bar.High&amp;gt;highpass[highpass.Count-1]) {SellLong+=3;} //18&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Console.WriteLine("BuyLong = {0}, SellLong = {1}", BuyLong, SellLong);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;Trailingstop = barserieLow;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt;(CrossBarPdown){ StopLoss = bar.Low ;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;}}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#808080 size=2&gt;&lt;P&gt;///&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;/// TRIGGERS END&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#808080 size=2&gt;///&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt; ////// StopLoss .......... &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#808080 size=2&gt;///&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt; &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;foreach&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(Position wichposition &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; myPositions){&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(bar.Close==StopLoss){ &lt;/P&gt;&lt;P&gt;PositionManager.ClosePosition(wichposition.PosID,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"StopLoss"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"StopLoss Close !!! {0}"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;, StopLoss);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#808080 size=2&gt;///&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// TrailingStop ............&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(bar.Close==Trailingstop){ &lt;/P&gt;&lt;P&gt;PositionManager.ClosePosition(wichposition.PosID,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Trailingstop"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"TrailingStop Close !!! {0}"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;, Trailingstop);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#808080 size=2&gt;&lt;P&gt;///&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;/// OPEN POSITION ///////////////&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; (BuyLong&amp;gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;){&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(DateTime.Now&amp;gt;exchangeOpen)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//List&amp;lt;Position&amp;gt; positions = PositionManager.GetOpenPositions(symbol);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;foreach&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(Position wichposition &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; myPositions)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(symbol==wichposition.Symbol){&lt;/P&gt;&lt;P&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Already Position "&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; + symbol);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//ClosePosition(wichposition.PosID);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;PositionOrder newPos = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; PositionOrder();&lt;/P&gt;&lt;P&gt;newPos.OrderSymbol = symbol;&lt;/P&gt;&lt;P&gt;newPos.PositionType = PositionType.Long;&lt;/P&gt;&lt;P&gt;newPos.OrderType = OrderType.Limit;&lt;/P&gt;&lt;P&gt;newPos.LimitPrice = bar.High; &lt;/P&gt;&lt;P&gt;newPos.BarsValid = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;3&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;;&lt;/P&gt;&lt;P&gt;PositionManager.OpenPosition(newPos);&lt;/P&gt;&lt;P&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Open Long "&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;+symbol);&lt;/P&gt;&lt;P&gt;ctext=String.Format(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"{0}"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Koop"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;); &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ypoint=(bar.Open &amp;gt; bar.Close) ? bar.Open : bar.Close; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Use higher point y-axis. &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ChartLabel lbl1 = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ChartLabel(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ChartPoint(point, ypoint+&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0.03&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;),&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Buy"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;+BuyLong);&lt;/P&gt;&lt;P&gt;lbl1.TextColor=Color.DarkBlue;&lt;/P&gt;&lt;P&gt;lbl1.LabelFont=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; Font(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Verdana"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;12&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,FontStyle.Bold);&lt;/P&gt;&lt;P&gt;ChartObjects.Add(symbol, lbl1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; (SellLong&amp;gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;){&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;foreach&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; (Position whichposition &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; myPositions) {&lt;/P&gt;&lt;P&gt;ClosePosition(whichposition.PosID);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//PositionManager.SetProfitTarget(whichposition.PosID,bar.Low,false);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ctext=String.Format(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"{0}"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Verkoop"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ypoint=(bar.Open &amp;gt; bar.Close) ? bar.Open : bar.Close; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Use higher point y-axis. &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ChartLabel lbl = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ChartLabel(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ChartPoint(point, bar.Low-&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;0.01&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;),&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Sell"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;+SellLong);&lt;/P&gt;&lt;P&gt;lbl.TextColor=Color.DarkBlue;&lt;/P&gt;&lt;P&gt;lbl.LabelFont=&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; Font(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Verdana"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;12&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,FontStyle.Bold);&lt;/P&gt;&lt;P&gt;ChartObjects.Add(symbol, lbl);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//if(!retVal.Success){&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"Position Closed "&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;+ symbol+&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;+ buypow);&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;playSimpleSound();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; (bars.Count &amp;gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;17&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Clear the previous lines from the chart. This will&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// allow for a single line that is always drawn against the&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// most recent bar.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; (ChartObjects[symbol] != &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;ChartObjects[symbol].Clear();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Retrieve our starting bar&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;BarData firstBar = SystemData.SymbolBars[symbol][bars.Count - &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;18&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;];&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Create a ChartPoint object against the "first" bar using the low price as the Y coordinate.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ChartPoint startPoint = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ChartPoint(firstBar.PriceDateTime, firstBar.Low);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Create the end point object using the current bar and the lower as the Y coordinate.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ChartPoint endPoint = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ChartPoint(bar.PriceDateTime, bar.Low);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Instantiate a ChartLine object. The line will be 2 pixels wide and painted dark green.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ChartLine line = &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ChartLine(startPoint, endPoint, Color.Pink, &lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;2&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Add this object to the chart objects collection in the system. This will allow the&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// object to be referenced later and also allows the object to be displayed on a chart&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// after the system runs.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;ChartObjects.Add(symbol, line);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//string pos = PositionManager.GetOpenPositions();&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;Actions.RunActions(symbol);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; playSimpleSound()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;simpleSound.Play();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;private&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; OrderFilled(Object src, OrderFilledEventArgs e)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;Symbol FillSymbol = e.Position.Symbol;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; FillName = e.Position.Symbol.Name;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; FillId = e.Position.PosID;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; FillPrice = e.Trade.Price.SymbolPrice;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;ulong&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; FillSize = e.Trade.Size;&lt;/P&gt;&lt;P&gt;DateTime FillTime = e.Trade.FilledTime; &lt;/P&gt;&lt;P&gt;OrderType Ordertype = e.Trade.OrderType;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;double&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; buypowChange = e.Trade.BuyingPowerChange;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(e.PositionState==Position.State.Open){&lt;/P&gt;&lt;P&gt;buyreserve -= buypowChange;&lt;/P&gt;&lt;P&gt;buypow+= buypowChange;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(e.PositionState==Position.State.Closed){&lt;/P&gt;&lt;P&gt;buyreserve += buypowChange;&lt;/P&gt;&lt;P&gt;buypow += buypowChange;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Console.WriteLine(Trade.Price);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"BuyingPower Change = {0},Naam: = {1} Openings prijs = {2}, Aantal aandelen = {3}, BuyingPower = {4}"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;,buypowChange,FillName,FillPrice,FillSize,buypow);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; OrderStatus(PositionManager.TradeOrderAndOrder to, Position pos, Position.State state, &lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000000&gt; information)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;int&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; canc=information.IndexOf(&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;"cancel"&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;); &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// "cancelled" is spelled a couple of different ways in the messages.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;(to.Order.OrderType == OrderType.Limit &amp;amp;&amp;amp; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Is it a buy-limit order?&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;(state == Position.State.None || &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Has state changed to None? OR&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;canc &amp;gt; -&lt;/FONT&gt;&lt;FONT face="Courier New" color=#800080 size=2&gt;1&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; ) ) &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Is "Cancel" in the message?&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;buyreserve -= PositionManager.FixedAmountPerPosition; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;// Undo reserve.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;} &lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 18 Jan 2008 15:15:15 GMT</pubDate><dc:creator>eeikel</dc:creator></item><item><title>Anyone making a consistent profit with a live system?</title><link>http://www.rightedgesystems.com/forums/Topic3385-9-1.aspx</link><description>I am new to automated trading systems but have a pretty solid IT/data mining background and tried my hand at daytrading a couple years back (making a small profit).  I was just curious as to how other people who are running live systems are doing and how much work it's been (both good and bad experiences).   I'm not asking for you to share your methods if you don't want to.&lt;/P&gt;&lt;P&gt;-Tom</description><pubDate>Thu, 16 Aug 2007 18:48:03 GMT</pubDate><dc:creator>tbwerz</dc:creator></item><item><title>Historical Data</title><link>http://www.rightedgesystems.com/forums/Topic4333-9-1.aspx</link><description>I am getting my historical data from OpenTick and the interface works great!  Much better than trying to get the data from IB.  My only issue is that OpenTick sends data for the extended sessions (before and after market hours) and throws off many of my charts. &lt;/P&gt;&lt;P&gt;1. Is there a param in RightEdge I can set so these extended periods are not loaded in my database?&lt;/P&gt;&lt;P&gt;If not, I guess I'll just load minute bars and manually delete these extended bars everytime I do a load.  I'll then consolidate the bars in my formulas.</description><pubDate>Thu, 17 Jan 2008 10:53:52 GMT</pubDate><dc:creator>RJ</dc:creator></item><item><title>History in live system</title><link>http://www.rightedgesystems.com/forums/Topic4320-9-1.aspx</link><description>When a live system is started the Bars list is empty.&lt;br&gt;How to fill the list with all history data available so the system can use the history bars as well as new coming live bars?</description><pubDate>Wed, 16 Jan 2008 11:52:03 GMT</pubDate><dc:creator>greg</dc:creator></item><item><title>Can you make a system that generates signals off one symbol but trades another symbol?</title><link>http://www.rightedgesystems.com/forums/Topic3890-9-1.aspx</link><description>That is generate the buy and sell points using one series, but then execute them (and calculate profit/loss) on another series.</description><pubDate>Mon, 05 Nov 2007 13:58:07 GMT</pubDate><dc:creator>Giffen</dc:creator></item><item><title>Console output ...</title><link>http://www.rightedgesystems.com/forums/Topic1194-9-1.aspx</link><description>Unless I am missing something or we need specific methods, it seems that&lt;P&gt;&lt;FONT face="Courier New, monospace"&gt;&lt;FONT color=#000000&gt;Console.WriteLine(&lt;/FONT&gt;&lt;FONT color=#800000&gt;"Test"&lt;/FONT&gt;&lt;FONT color=#000000&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Does not produce anything in the output pane.</description><pubDate>Sun, 18 Feb 2007 12:55:45 GMT</pubDate><dc:creator>Siasb</dc:creator></item><item><title>Bar Frequency</title><link>http://www.rightedgesystems.com/forums/Topic3852-9-1.aspx</link><description>Guys, &lt;/P&gt;&lt;P&gt;I have several formulas working on symbols that have a daily bar history.  Now I want to run some modified formulas on weekly bar data for the same symbols.  How can I assign bar frequency in a formula?  I see the barfrequency property but no example of how to apply it.  I mean, if I have daily data, shouldn't I be able to aggregate?</description><pubDate>Fri, 26 Oct 2007 12:46:36 GMT</pubDate><dc:creator>RJ</dc:creator></item><item><title>Finding Stocks with 3-Month High Volume</title><link>http://www.rightedgesystems.com/forums/Topic3768-9-1.aspx</link><description>I have a bunch of Wealth-lab scripts which finds stocks with particular criteria and stores them in watchlists.  I am trying to port them to RE.  Here is one of the scripts which finds all stocks with 3-Month High Volume:&lt;br&gt;&lt;br&gt;&lt;table border=1 color=white &gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt; &lt;font color="#ffaaff"&gt; 1 &lt;/font&gt;&lt;font color="#00bb00"&gt;var&lt;/font&gt; symbolCounter&lt;font color="#804040"&gt;,&lt;/font&gt; counter2&lt;font color="#804040"&gt;,&lt;/font&gt; bar&lt;font color="#804040"&gt;:&lt;/font&gt; &lt;font color="#00bb00"&gt;integer&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 2 &lt;/font&gt;&lt;font color="#00bb00"&gt;var&lt;/font&gt; is3MHigh &lt;font color="#804040"&gt;:&lt;/font&gt; &lt;font color="#00bb00"&gt;boolean&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 3 &lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 4 &lt;/font&gt;&lt;font color="#5577ff"&gt;WatchListClear&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; &lt;font color="#ff00ff"&gt;'3-M High Volume'&lt;/font&gt; &lt;font color="#804040"&gt;);&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 5 &lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 6 &lt;/font&gt;&lt;font color="#5577ff"&gt;EnableSynch&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; &lt;font color="#00bb00"&gt;false&lt;/font&gt; &lt;font color="#804040"&gt;);&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 7 &lt;/font&gt;counter2 &lt;font color="#804040"&gt;:=&lt;/font&gt; &lt;font color="#ff00ff"&gt;0&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 8 &lt;/font&gt;&lt;font color="#00bb00"&gt;for&lt;/font&gt; symbolCounter &lt;font color="#804040"&gt;:=&lt;/font&gt; &lt;font color="#ff00ff"&gt;0&lt;/font&gt; &lt;font color="#00bb00"&gt;to&lt;/font&gt; &lt;font color="#5577ff"&gt;WatchListCount&lt;/font&gt; &lt;font color="#804040"&gt;-&lt;/font&gt; &lt;font color="#ff00ff"&gt;1&lt;/font&gt; &lt;font color="#00bb00"&gt;do&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt; 9 &lt;/font&gt;&lt;font color="#00bb00"&gt;begin&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;10 &lt;/font&gt;    &lt;font color="#5577ff"&gt;PrintStatus&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt;&lt;font color="#ff00ff"&gt;'Running: '&lt;/font&gt; &lt;font color="#804040"&gt;+&lt;/font&gt; &lt;font color="#5577ff"&gt;IntToStr&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt;symbolCounter&lt;font color="#804040"&gt;+&lt;/font&gt;&lt;font color="#ff00ff"&gt;1&lt;/font&gt;&lt;font color="#804040"&gt;)&lt;/font&gt; &lt;font color="#804040"&gt;+&lt;/font&gt; &lt;font color="#ff00ff"&gt;'/'&lt;/font&gt; &lt;font color="#804040"&gt;+&lt;/font&gt; &lt;font color="#5577ff"&gt;IntToStr&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt;&lt;font color="#5577ff"&gt;WatchListCount&lt;/font&gt;&lt;font color="#804040"&gt;));&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;11 &lt;/font&gt;    &lt;font color="#5577ff"&gt;SetPrimarySeries&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; &lt;font color="#5577ff"&gt;WatchListSymbol&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; symbolCounter &lt;font color="#804040"&gt;));&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;12 &lt;/font&gt;    &lt;font color="#00bb00"&gt;if&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; &lt;font color="#5577ff"&gt;BarCount&lt;/font&gt; &lt;font color="#804040"&gt;&amp;lt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;66&lt;/font&gt; &lt;font color="#804040"&gt;)&lt;/font&gt; &lt;font color="#00bb00"&gt;then&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;13 &lt;/font&gt;        &lt;font color="#00bb00"&gt;continue&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;14 &lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;15 &lt;/font&gt;    is3MHigh &lt;font color="#804040"&gt;:=&lt;/font&gt; &lt;font color="#00bb00"&gt;true&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;16 &lt;/font&gt;    &lt;font color="#00bb00"&gt;for&lt;/font&gt; bar &lt;font color="#804040"&gt;:=&lt;/font&gt; &lt;font color="#5577ff"&gt;BarCount&lt;/font&gt; &lt;font color="#804040"&gt;-&lt;/font&gt; &lt;font color="#ff00ff"&gt;66&lt;/font&gt; &lt;font color="#00bb00"&gt;to&lt;/font&gt; &lt;font color="#5577ff"&gt;BarCount&lt;/font&gt; &lt;font color="#804040"&gt;-&lt;/font&gt; &lt;font color="#ff00ff"&gt;2&lt;/font&gt; &lt;font color="#00bb00"&gt;do&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;17 &lt;/font&gt;        &lt;font color="#00bb00"&gt;if&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; @&lt;font color="#007777"&gt;#Volume&lt;/font&gt;&lt;font color="#008080"&gt;[&lt;/font&gt;bar&lt;font color="#008080"&gt;]&lt;/font&gt; &lt;font color="#804040"&gt;&amp;gt;=&lt;/font&gt; @&lt;font color="#007777"&gt;#Volume&lt;/font&gt;&lt;font color="#008080"&gt;[&lt;/font&gt;&lt;font color="#5577ff"&gt;BarCount&lt;/font&gt;&lt;font color="#ff00ff"&gt;-1&lt;/font&gt;&lt;font color="#008080"&gt;]&lt;/font&gt; &lt;font color="#804040"&gt;)&lt;/font&gt; &lt;font color="#00bb00"&gt;then&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;18 &lt;/font&gt;            is3MHigh &lt;font color="#804040"&gt;:=&lt;/font&gt; &lt;font color="#00bb00"&gt;false&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;19 &lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;20 &lt;/font&gt;    &lt;font color="#00bb00"&gt;if&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; is3MHigh &lt;font color="#804040"&gt;)&lt;/font&gt; &lt;font color="#00bb00"&gt;then&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;21 &lt;/font&gt;    &lt;font color="#00bb00"&gt;begin&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;22 &lt;/font&gt;        &lt;font color="#5577ff"&gt;WatchListAddSymbol&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; &lt;font color="#ff00ff"&gt;'3-M High Volume'&lt;/font&gt;&lt;font color="#804040"&gt;,&lt;/font&gt; &lt;font color="#ff00ff"&gt;''&lt;/font&gt;&lt;font color="#804040"&gt;,&lt;/font&gt; &lt;font color="#5577ff"&gt;GetSymbol&lt;/font&gt; &lt;font color="#804040"&gt;);&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;23 &lt;/font&gt;        counter2 &lt;font color="#804040"&gt;:=&lt;/font&gt; counter2 &lt;font color="#804040"&gt;+&lt;/font&gt; &lt;font color="#ff00ff"&gt;1&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;24 &lt;/font&gt;    &lt;font color="#00bb00"&gt;end&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;25 &lt;/font&gt;&lt;font color="#00bb00"&gt;end&lt;/font&gt;&lt;font color="#804040"&gt;;&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;26 &lt;/font&gt;&lt;font color="#5577ff"&gt;RestorePrimarySeries&lt;/font&gt;&lt;font color="#804040"&gt;();&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;27 &lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;28 &lt;/font&gt;&lt;font color="#5577ff"&gt;Print&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; &lt;font color="#ff00ff"&gt;'Number of 3-M High Volume stocks = '&lt;/font&gt; &lt;font color="#804040"&gt;+&lt;/font&gt; &lt;font color="#5577ff"&gt;IntToStr&lt;/font&gt;&lt;font color="#804040"&gt;(&lt;/font&gt; counter2 &lt;font color="#804040"&gt;));&lt;/font&gt;&lt;BR&gt; &lt;font color="#ffaaff"&gt;29 &lt;/font&gt; &lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Can anybody help me in writing the equivalent RE script ? &lt;br&gt;&lt;br&gt;How do we post code here?  I tried "code" IFCode, but that didn't work. I had to use some tricks to post the above code.&lt;br&gt;</description><pubDate>Wed, 10 Oct 2007 23:12:02 GMT</pubDate><dc:creator>sarah</dc:creator></item><item><title>Stochastic Formula Question</title><link>http://www.rightedgesystems.com/forums/Topic3617-9-1.aspx</link><description>I'm just starting to write some systems and need some help with some code.  Below I'm trying to do a simple Stoch crossover buy and sell.  However I don't think it recognizes my inputs as a series or something.  I can get it to run and plot the stoch indicators, but I get an error when trying to evaluate the crossover.  Below is the code and error.  I'm sure this is a simple fix.&lt;/P&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#000000&gt; System &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#000000&gt; System.Drawing &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#000000&gt; System.Collections.Generic &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#000000&gt; RightEdge.Common &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#000000&gt; RightEdge.Indicators &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;FONT face=Arial color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Class&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#000000&gt; SystemMain &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Inherits&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; SystemBase &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Overloads&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Overrides&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; Startup() &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Perform initialization or set system wide options here&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Construct our two simple moving averages.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoc1"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).CreateIndicator(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; StochasticOscillator(&lt;/FONT&gt;&lt;FONT face=Arial color=#800080 size=2&gt;10&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;,&lt;/FONT&gt;&lt;FONT face=Arial color=#800080 size=2&gt;3&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;))&lt;/P&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"StocD"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).CreateIndicator(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; StochasticOscillatorD(&lt;/FONT&gt;&lt;FONT face=Arial color=#800080 size=2&gt;10&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;,&lt;/FONT&gt;&lt;FONT face=Arial color=#800080 size=2&gt;3&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;,&lt;/FONT&gt;&lt;FONT face=Arial color=#800080 size=2&gt;3&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Note: SMA's are chainable indicators and can use&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' bar elements as well as other indicators as input. In this&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' case, we'll simply set the input as the bar's closing price&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Set the line color to green.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoc1"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).SeriesColor = Color.Blue&lt;/P&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"StocD"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).SeriesColor = Color.Red&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Let's make our signal line dashed.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoc1"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).LineType = SeriesLineType.Solid&lt;/P&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"StocD"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).LineType = SeriesLineType.Solid&lt;/P&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoc1"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).ChartPaneName = &lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoch"&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"StocD"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).ChartPaneName = &lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoch"&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Add this indicator to the charts.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoc1"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).AddToCharts()&lt;/P&gt;&lt;P&gt;Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"StocD"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;).AddToCharts()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Overloads&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Overrides&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; NewSymbolBar(&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; symbol &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; Symbol, &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; bar &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; BarData) &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Get the indicator instances for this symbol at this bar&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; iStoch1 &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; ISeries = Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"Stoch1"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;)(symbol)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; iStochD &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; ISeries = Indicators(&lt;/FONT&gt;&lt;FONT face=Arial color=#800000 size=2&gt;"StochD"&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;)(symbol)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' Test for a crossover. This is our buy signal&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; SystemUtils.CrossOver(iStoch1,iStochD) &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' They've crossed, open a long position&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;OpenPosition(symbol, PositionType.Long, OrderType.Market) &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; SystemUtils.CrossUnder(iStoch1,iStochD) &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' See if there are any positions to be closed.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; positions &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; List (&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; Position) = PositionManager.GetOpenPositions(symbol)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; position &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; Position &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; positions&lt;/P&gt;&lt;P&gt;ClosePosition(position.PosID)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Next&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#008000 size=2&gt;' This line of code runs the actions you have set up in in the Project Form&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;P&gt;Actions.RunActions(symbol) &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt; &lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;P&gt;End&lt;/FONT&gt;&lt;FONT face=Arial color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;Class&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;And the Error is:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;An exception of type System.NullReferenceException was thrown.&lt;BR&gt;Object reference not set to an instance of an object.&lt;BR&gt;   at RightEdge.Common.SystemUtils.CrossOver(ISeries Signal, ISeries Base)&lt;BR&gt;   at SystemMain.NewSymbolBar(Symbol symbol, BarData bar) in C:\Program Files\Yye Software\RightEdge\Samples\Sample Systems\VB.NET\StochCrossOver\CrossOver.vb:line 46&lt;BR&gt;   at RightEdge.Common.SystemBase.NewBar()&lt;BR&gt;   at RightEdge.SystemWrapper.NewBar(Dictionary`2 bars)&lt;BR&gt;   at RightEdge.SystemWrapper.x52ef4d2a0d98271a(SystemData x98d4678c2951cc7a, SystemRunInfo x9d1811d594cb536b, Dictionary`2 x2c50334dbe0bafd0, String xe7444de1f6d6a785)&lt;BR&gt;   at RightEdge.SystemWrapper.RunSystem(DateTime start, String filename)&lt;BR&gt;   at RightEdge.SystemWrapper.RunSystem(DateTime start, String filename)&lt;BR&gt;   at RightEdge.TradingModuleWrapper.RunSystem(SystemDataCreationSettings settings, Dictionary`2 historicalData, SystemRunInfo dndInfo, String brokerService)&lt;BR&gt;   at RightEdge.SystemProgress.InitAndRunSystem()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial color=#0000ff size=2&gt; &lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 21 Sep 2007 14:46:48 GMT</pubDate><dc:creator>RJ</dc:creator></item><item><title>RightEdge w/ Visual Studio</title><link>http://www.rightedgesystems.com/forums/Topic3591-9-1.aspx</link><description>I've read through these form posts and it seems that several times it is hinted that I'd be able to use the RightEdge assemblies directly in Visual Studio and be able to bypass the rest of the framework entirely.&lt;br&gt;&lt;br&gt;I'm not talking about using Visual Studio to create a plug-in.  That is straight-forward.  I mean using VS to create several different strategies (sometimes w/ same and sometimes different instruments) and to run all these strategies simultaneously.  I've heard that you're working on a multi-strategy implementation but I think it's unlikely that it will provide three things I'd need desperately:&lt;br&gt;&lt;br&gt;a)  The strategies would all have to be able to communicate position and risk information to each other so that they can both adjust the level of additional risk they will take on and send the information to another strategy - a hedger.&lt;br&gt;&lt;br&gt;b) VS's nice debugging tools.&lt;br&gt;&lt;br&gt;c) custom GUI's to tweak the strategies while they are running&lt;br&gt;&lt;br&gt;Is there some walk through for exactly what the rightedge framework does when it starts to run a strategy and if there would be any conflict running multiple strategies at once through VS?&lt;br&gt;&lt;br&gt;&lt;br&gt;One more question - about indicators.  All the data I use is tick data but I can't seem to get an indicator to work on tick data - just bars - which is not what I'm going for.&lt;br&gt;&lt;br&gt;</description><pubDate>Wed, 19 Sep 2007 20:22:08 GMT</pubDate><dc:creator>garachen</dc:creator></item><item><title>Saving and Restoring Position Data</title><link>http://www.rightedgesystems.com/forums/Topic3505-9-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I am new to RightEdge and have built a fairly simple trading system. I use the system to make purchases but these purchases aren't exactly as the output dictates, and I don't make all trades suggested.&lt;/P&gt;&lt;P&gt;I am looking for a way to tell the system which trades I HAVE made so that it knows about these and can give sell signals each time I run the system.&lt;/P&gt;&lt;P&gt;Is this possible somehow through serialization and deserialization of position data? Which classes/methods would I use?&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Phoebe</description><pubDate>Sun, 09 Sep 2007 01:45:19 GMT</pubDate><dc:creator>phoebe007</dc:creator></item><item><title>System Results Differ</title><link>http://www.rightedgesystems.com/forums/Topic3451-9-1.aspx</link><description>I have a trading system that I coded for one symbol only but have moved it to trade multiple systems by using a dictionary to store values for each symbol. For some reason the system with the dictionary has different results. It only takes 8 trades while the other one takes 15. Can any one see what I have done wrong as I can't&lt;br&gt;&lt;br&gt;[code]&lt;br&gt;Imports System&lt;br&gt;Imports System.Drawing&lt;br&gt;Imports RightEdge.Common.ChartObjects&lt;br&gt;Imports System.Drawing.Text&lt;br&gt;Imports System.Collections.Generic&lt;br&gt;Imports RightEdge.Common&lt;br&gt;Imports RightEdge.Indicators&lt;br&gt;&lt;br&gt;&lt;br&gt;Public Class SystemMain&lt;br&gt;    Inherits SystemBase&lt;br&gt;&lt;br&gt;    Private breakout As New Dictionary(Of String, BreakOutInfo.SymbolStatus)&lt;br&gt;    Dim symbolBreakout As BreakOutInfo.SymbolStatus&lt;br&gt;&lt;br&gt;    Public Overrides Sub Startup()&lt;br&gt;        ' Perform initialization or set system wide options here&lt;br&gt;&lt;br&gt;        AddHandler PositionManager.OrderFilled, AddressOf OrderFilled&lt;br&gt;        AddHandler PositionManager.OrderUpdated, AddressOf OrderUpdated&lt;br&gt;&lt;br&gt;        Indicators("ATR").CreateIndicator(New AverageTrueRange(SystemParameters.Item("ATR")))&lt;br&gt;        Indicators("ATR").SeriesColor = Color.Red&lt;br&gt;        Indicators("ATR").ChartPaneName = "ATRPane"&lt;br&gt;        Indicators("ATR").AddToCharts()&lt;br&gt;&lt;br&gt;&lt;br&gt;        PositionManager.PositionTimeOut = 0&lt;br&gt;        PositionManager.ProfitTarget = 0&lt;br&gt;        PositionManager.StopLoss = 0&lt;br&gt;&lt;br&gt;        SystemData.Output.OutputLines.Clear()&lt;br&gt;&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;    Public Overrides Sub NewSymbolBar(ByVal symbol As Symbol, ByVal bar As BarData)&lt;br&gt;        ' This line of code runs the actions you have set up in in the Project Form&lt;br&gt;&lt;br&gt;        Dim bars As List(Of BarData) = SystemData.BarCollections(symbol)&lt;br&gt;        Dim pricePane As ChartPane = GetPricePane(symbol)&lt;br&gt;&lt;br&gt;&lt;br&gt;        If Not breakout.ContainsKey(symbol.Name) Then&lt;br&gt;            breakout.Add(symbol.Name, symbolBreakout)&lt;br&gt;            'SystemData.Output.Add(OutputSeverityLevel.Informational, "1")&lt;br&gt;        Else&lt;br&gt;            breakout.TryGetValue(symbol.Name, symbolBreakout)&lt;br&gt;            'SystemData.Output.Add(OutputSeverityLevel.Informational, "2")&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;        If bars.Count &gt; 8 And Not symbolBreakout.blnLookingforBreakout And PositionManager.GetOpenPositions.Count = 0 Then ' ensure we have enough bars to proceed&lt;br&gt;&lt;br&gt;            If bars.Item(bars.Count - 4).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 4).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                If bars.Item(bars.Count - 3).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 3).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                    If bars.Item(bars.Count - 2).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 2).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                        If bars.Item(bars.Count - 1).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 1).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                            'if we are here we may want to place a trade&lt;br&gt;                            pricePane.SetBarColor(bar, bar, Color.LimeGreen)&lt;br&gt;&lt;br&gt;                            symbolBreakout.blnLookingforBreakout = True&lt;br&gt;&lt;br&gt;                            'Get our Breakout price +/- 2 pips&lt;br&gt;                            symbolBreakout.dblHighPrice = BarUtils.HighestHigh(bars, bars.Count - 4, 4) '+ (GetOnePip(symbol) * 2))&lt;br&gt;                            symbolBreakout.dblLowPrice = BarUtils.LowestLow(bars, bars.Count - 4, 4) '- (GetOnePip(symbol) * 2))&lt;br&gt;                            symbolBreakout.strSymbol = symbol.Name&lt;br&gt;&lt;br&gt;                        End If&lt;br&gt;                    End If&lt;br&gt;                End If&lt;br&gt;            End If&lt;br&gt;&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        'check the date/time to make sure we are not on a weekend.&lt;br&gt;        If bar.PriceDateTime.DayOfWeek = DayOfWeek.Saturday Or bar.PriceDateTime.DayOfWeek = DayOfWeek.Sunday _&lt;br&gt;            Or (bar.PriceDateTime.DayOfWeek = DayOfWeek.Friday And bar.PriceDateTime.Hour &gt;= 13) Then&lt;br&gt;            symbolBreakout.blnLookingforBreakout = False&lt;br&gt;            symbolBreakout.dblHighPrice = 0&lt;br&gt;            symbolBreakout.dblLowPrice = 0&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;&lt;br&gt;        If symbolBreakout.blnLookingforBreakout And PositionManager.GetOpenPositions.Count = 0 Then&lt;br&gt;            SystemData.Output.Add(OutputSeverityLevel.Informational, symbolBreakout.dblHighPrice.ToString &amp; " " &amp; bar.PriceDateTime.ToString("yyyy-MM-dd") &amp; " " &amp; bar.PriceDateTime.ToLongTimeString)&lt;br&gt;            OpenPosition(symbol, PositionType.Long, OrderType.Stop, symbolBreakout.dblHighPrice)&lt;br&gt;            OpenPosition(symbol, PositionType.Short, OrderType.Stop, symbolBreakout.dblLowPrice)&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        Actions.RunActions(symbol)&lt;br&gt;&lt;br&gt;        'clean up&lt;br&gt;        'symbolBreakout = Nothing&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;    Private Sub OrderFilled(ByVal trade As Trade, ByVal pos As Position, ByVal state As Position.State)&lt;br&gt;        Dim pt As Double&lt;br&gt;        Dim sl As Double&lt;br&gt;        Dim ATRSeries As ISeries = Indicators("ATR")(pos.Symbol)&lt;br&gt;        Dim ATRValue As Double = ATRSeries(ATRSeries.Count - 1)&lt;br&gt;&lt;br&gt;        If state = Position.State.Closed Then Exit Sub&lt;br&gt;&lt;br&gt;        'Set the TP and SL levels with the ATR value&lt;br&gt;        If trade.Type = BrokerTransactionType.Buy Then&lt;br&gt;            pt = trade.Price + (SystemParameters.Item("ATRTP") * ATRValue)&lt;br&gt;            sl = trade.Price - (SystemParameters.Item("ATRSL") * ATRValue)&lt;br&gt;        Else&lt;br&gt;            pt = trade.Price - (SystemParameters.Item("ATRTP") * ATRValue)&lt;br&gt;            sl = trade.Price + (SystemParameters.Item("ATRSL") * ATRValue)&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        'update the sl and tp levels&lt;br&gt;        PositionManager.SetProfitTarget(pos.PosID, pt, False)&lt;br&gt;        PositionManager.SetStopLoss(pos.PosID, sl, False)&lt;br&gt;&lt;br&gt;&lt;br&gt;        If Not breakout.ContainsKey(pos.Symbol.Name) Then&lt;br&gt;            breakout.Add(pos.Symbol.Name, symbolBreakout)&lt;br&gt;        Else&lt;br&gt;            breakout.TryGetValue(pos.Symbol.Name, symbolBreakout)&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        symbolBreakout.blnLookingforBreakout = False&lt;br&gt;        symbolBreakout.dblHighPrice = 0&lt;br&gt;        symbolBreakout.dblLowPrice = 0&lt;br&gt;&lt;br&gt;        'clean up&lt;br&gt;        symbolBreakout = Nothing&lt;br&gt;&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;    Private Sub OrderUpdated(ByVal tando As RightEdge.Common.PositionManager.TradeOrderAndOrder, ByVal pos As RightEdge.Common.Position, ByVal state As RightEdge.Common.Position.State, ByVal information As String)&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;    Private Function GetOnePip(ByVal Symbol As String) As Double&lt;br&gt;&lt;br&gt;        If Symbol.IndexOf("JPY") &gt; 0 Then&lt;br&gt;            GetOnePip = 0.01&lt;br&gt;        Else&lt;br&gt;            GetOnePip = 0.0001&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;    End Function&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;    Class BreakOutInfo&lt;br&gt;        ' Add or delete 'rules' to this structure definition.&lt;br&gt;        ' Items are initialized to default values that cannot be changed &lt;br&gt;        ' in the structure definition; see the constructor.&lt;br&gt;        Public Structure SymbolStatus&lt;br&gt;            Public blnLookingforBreakout As Boolean&lt;br&gt;            Public dblHighPrice As Double&lt;br&gt;            Public dblLowPrice As Double&lt;br&gt;            Public outsidebar As BarData&lt;br&gt;            Public strSymbol As String&lt;br&gt;        End Structure&lt;br&gt;&lt;br&gt;        Public theStatus As SymbolStatus&lt;br&gt;&lt;br&gt;        ' Instantiate this in Startup()       &lt;br&gt;        Public Sub New()&lt;br&gt;&lt;br&gt;            theStatus.blnLookingforBreakout = False&lt;br&gt;            theStatus.dblHighPrice = 0&lt;br&gt;            theStatus.dblLowPrice = 0&lt;br&gt;            theStatus.strSymbol = ""&lt;br&gt;&lt;br&gt;        End Sub&lt;br&gt;&lt;br&gt;    End Class&lt;br&gt;&lt;br&gt;End Class&lt;br&gt;&lt;br&gt;[/code]&lt;br&gt;[b]&lt;br&gt;System without Dictionary[/b]&lt;br&gt;&lt;br&gt;[code]&lt;br&gt;Imports System&lt;br&gt;Imports System.Drawing&lt;br&gt;Imports RightEdge.Common.ChartObjects&lt;br&gt;Imports System.Drawing.Text&lt;br&gt;Imports System.Collections.Generic&lt;br&gt;Imports RightEdge.Common&lt;br&gt;Imports RightEdge.Indicators&lt;br&gt;&lt;br&gt;&lt;br&gt;Public Class SystemMain&lt;br&gt;    Inherits SystemBase&lt;br&gt;&lt;br&gt;    Private breakout As New BreakOutInfo.SymbolStatus '. New Dictionary(Of String, BreakOutInfo.SymbolStatus)&lt;br&gt;&lt;br&gt;&lt;br&gt;    Public Overrides Sub Startup()&lt;br&gt;        ' Perform initialization or set system wide options here&lt;br&gt;&lt;br&gt;        AddHandler PositionManager.OrderFilled, AddressOf OrderFilled&lt;br&gt;        AddHandler PositionManager.OrderUpdated, AddressOf OrderUpdated&lt;br&gt;&lt;br&gt;        Indicators("ATR").CreateIndicator(New AverageTrueRange(SystemParameters.Item("ATR")))&lt;br&gt;        Indicators("ATR").SeriesColor = Color.Red&lt;br&gt;        Indicators("ATR").ChartPaneName = "ATRPane"&lt;br&gt;        Indicators("ATR").AddToCharts()&lt;br&gt;&lt;br&gt;&lt;br&gt;        PositionManager.PositionTimeOut = 0&lt;br&gt;        PositionManager.ProfitTarget = 0&lt;br&gt;        PositionManager.StopLoss = 0&lt;br&gt;&lt;br&gt;        SystemData.Output.OutputLines.Clear()&lt;br&gt;&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;    Public Overrides Sub NewSymbolBar(ByVal symbol As Symbol, ByVal bar As BarData)&lt;br&gt;        ' This line of code runs the actions you have set up in in the Project Form&lt;br&gt;&lt;br&gt;        Dim bars As List(Of BarData) = SystemData.BarCollections(symbol)&lt;br&gt;        Dim pricePane As ChartPane = GetPricePane(symbol)&lt;br&gt;&lt;br&gt;&lt;br&gt;        If bars.Count &gt; 8 And Not breakout.blnLookingforBreakout And PositionManager.GetOpenPositions.Count = 0 Then ' ensure we have enough bars to proceed&lt;br&gt;&lt;br&gt;            If bars.Item(bars.Count - 4).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 4).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                If bars.Item(bars.Count - 3).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 3).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                    If bars.Item(bars.Count - 2).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 2).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                        If bars.Item(bars.Count - 1).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 1).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                            'if we are here we may want to place a trade&lt;br&gt;                            pricePane.SetBarColor(bar, bar, Color.LimeGreen)&lt;br&gt;&lt;br&gt;                            breakout.blnLookingforBreakout = True&lt;br&gt;&lt;br&gt;                            'Get our Breakout price +/- 2 pips&lt;br&gt;                            breakout.dblHighPrice = BarUtils.HighestHigh(bars, bars.Count - 4, 4) '+ (GetOnePip(symbol) * 2))&lt;br&gt;                            breakout.dblLowPrice = BarUtils.LowestLow(bars, bars.Count - 4, 4) '- (GetOnePip(symbol) * 2))&lt;br&gt;                            breakout.strSymbol = symbol&lt;br&gt;&lt;br&gt;                        End If&lt;br&gt;                    End If&lt;br&gt;                End If&lt;br&gt;            End If&lt;br&gt;&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        'check the date/time to make sure we are not on a weekend.&lt;br&gt;        If bar.PriceDateTime.DayOfWeek = DayOfWeek.Saturday Or bar.PriceDateTime.DayOfWeek = DayOfWeek.Sunday _&lt;br&gt;            Or (bar.PriceDateTime.DayOfWeek = DayOfWeek.Friday And bar.PriceDateTime.Hour &gt;= 13) Then&lt;br&gt;            breakout.blnLookingforBreakout = False&lt;br&gt;            breakout.dblHighPrice = 0&lt;br&gt;            breakout.dblLowPrice = 0&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;&lt;br&gt;        If breakout.blnLookingforBreakout And PositionManager.GetOpenPositions.Count = 0 Then&lt;br&gt;            OpenPosition(symbol, PositionType.Long, OrderType.Stop, breakout.dblHighPrice)&lt;br&gt;            OpenPosition(symbol, PositionType.Short, OrderType.Stop, breakout.dblLowPrice)&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        Actions.RunActions(symbol)&lt;br&gt;&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;    Private Sub OrderFilled(ByVal trade As Trade, ByVal pos As Position, ByVal state As Position.State)&lt;br&gt;        Dim pt As Double&lt;br&gt;        Dim sl As Double&lt;br&gt;        Dim ATRSeries As ISeries = Indicators("ATR")(pos.Symbol)&lt;br&gt;        Dim ATRValue As Double = ATRSeries(ATRSeries.Count - 1)&lt;br&gt;&lt;br&gt;        If state = Position.State.Closed Then Exit Sub&lt;br&gt;&lt;br&gt;        'Set the TP and SL levels with the ATR value&lt;br&gt;        If trade.Type = BrokerTransactionType.Buy Then&lt;br&gt;            pt = trade.Price + (SystemParameters.Item("ATRTP") * ATRValue)&lt;br&gt;            sl = trade.Price - (SystemParameters.Item("ATRSL") * ATRValue)&lt;br&gt;        Else&lt;br&gt;            pt = trade.Price - (SystemParameters.Item("ATRTP") * ATRValue)&lt;br&gt;            sl = trade.Price + (SystemParameters.Item("ATRSL") * ATRValue)&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        'update the sl and tp levels&lt;br&gt;        PositionManager.SetProfitTarget(pos.PosID, pt, False)&lt;br&gt;        PositionManager.SetStopLoss(pos.PosID, sl, False)&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;        breakout.blnLookingforBreakout = False&lt;br&gt;        breakout.dblHighPrice = 0&lt;br&gt;        breakout.dblLowPrice = 0&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;    Private Sub OrderUpdated(ByVal tando As RightEdge.Common.PositionManager.TradeOrderAndOrder, ByVal pos As RightEdge.Common.Position, ByVal state As RightEdge.Common.Position.State, ByVal information As String)&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;    Private Function GetOnePip(ByVal Symbol As String) As Double&lt;br&gt;&lt;br&gt;        If Symbol.IndexOf("JPY") &gt; 0 Then&lt;br&gt;            GetOnePip = 0.01&lt;br&gt;        Else&lt;br&gt;            GetOnePip = 0.0001&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;    End Function&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;    Class BreakOutInfo&lt;br&gt;        ' Add or delete 'rules' to this structure definition.&lt;br&gt;        ' Items are initialized to default values that cannot be changed &lt;br&gt;        ' in the structure definition; see the constructor.&lt;br&gt;        Public Structure SymbolStatus&lt;br&gt;            Public blnLookingforBreakout As Boolean&lt;br&gt;            Public dblHighPrice As Double&lt;br&gt;            Public dblLowPrice As Double&lt;br&gt;            Public outsidebar As BarData&lt;br&gt;            Public strSymbol As String&lt;br&gt;        End Structure&lt;br&gt;&lt;br&gt;        Public theStatus As SymbolStatus&lt;br&gt;&lt;br&gt;        ' Instantiate this in Startup()       &lt;br&gt;        Public Sub New() ' ByVal systemData As SystemData&lt;br&gt;&lt;br&gt;            theStatus.blnLookingforBreakout = False&lt;br&gt;            theStatus.dblHighPrice = 0&lt;br&gt;            theStatus.dblLowPrice = 0&lt;br&gt;            theStatus.strSymbol = ""&lt;br&gt;&lt;br&gt;        End Sub&lt;br&gt;&lt;br&gt;    End Class&lt;br&gt;End Class&lt;br&gt;[/code]&lt;br&gt;&lt;br&gt;Not sure what is going on with the code tags either. I can not get them to work.</description><pubDate>Fri, 24 Aug 2007 08:11:04 GMT</pubDate><dc:creator>kaizen</dc:creator></item><item><title>Simulating FX trading with RE</title><link>http://www.rightedgesystems.com/forums/Topic3406-9-1.aspx</link><description>Hi,&lt;br&gt;&lt;br&gt;I am just having a look through RE at the moment and am interested to know if anyone has accurately simulated the effects of spread for FX systems.&lt;br&gt;&lt;br&gt;I have used Wealth Lab in the past and wrote my own functions to correctly model stop orders when using mid data.  Is there anything already out there?&lt;br&gt;&lt;br&gt;Cheers&lt;br&gt;&lt;br&gt;Russel</description><pubDate>Sun, 19 Aug 2007 09:54:53 GMT</pubDate><dc:creator>russ1111</dc:creator></item><item><title>GotTickData TickListener: how does it work?</title><link>http://www.rightedgesystems.com/forums/Topic3135-9-1.aspx</link><description>Hello&lt;br&gt;Does anyone have working realtime data retrival plugin code?&lt;br&gt;Please help :)&lt;br&gt;Don`t understand how does this  [b]TickListener[/b]   property works  :(</description><pubDate>Wed, 01 Aug 2007 07:23:54 GMT</pubDate><dc:creator>sh2mg136</dc:creator></item><item><title>Troubles with Custom Settings</title><link>http://www.rightedgesystems.com/forums/Topic3197-9-1.aspx</link><description>Hi&lt;br&gt;Could you put some more information about adding custom settings in ( for example ) DataRetrieval plugin?&lt;br&gt;I try this [url=http://www.rightedgesystems.com/forums/Topic1377-11-1.aspx?Highlight=PaperTraderSettings]New methods added to IService Interface[/url] example, but  settings are not saved  after CustomSEttings Dialog closed.&lt;br&gt;&lt;br&gt;     if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)&lt;br&gt;    {&lt;br&gt;        settings["FlatCommission"] = dlg.FlatCommission.ToString();&lt;br&gt;        ...&lt;br&gt;        ??? how can I save my custom settings?  :)&lt;br&gt;&lt;br&gt;&lt;br&gt;Another words, does RE do it automaticaly  :)  or  I must use my own methods to save settings in (for example) Registry and restore it when CustomSettingDialog opened?&lt;br&gt;Could you put fully functional example pleeease? :)&lt;br&gt;---&lt;br&gt;sorry for my english and thnx,&lt;br&gt;sh2mg136</description><pubDate>Mon, 06 Aug 2007 04:44:30 GMT</pubDate><dc:creator>sh2mg136</dc:creator></item><item><title>Looking to Create Crude Oil Trading System</title><link>http://www.rightedgesystems.com/forums/Topic2449-9-1.aspx</link><description>I would like to create an automated system to day-trade crude oil futures.&lt;br&gt;&lt;br&gt;If you would like to collaborate with me, please reply.&lt;br&gt;&lt;br&gt;Thanks.</description><pubDate>Fri, 11 May 2007 11:41:57 GMT</pubDate><dc:creator>davidfw1866</dc:creator></item><item><title>Spread Trading System</title><link>http://www.rightedgesystems.com/forums/Topic3167-9-1.aspx</link><description>Hi All,&lt;br&gt;&lt;br&gt;I appreciate if anyone would code the following spread trading idea into an indicator/system for RightEdge:&lt;br&gt;If (3*InstrumentA) - (2*InstrumentB) &lt;= Variable X then&lt;br&gt;Buy 3 contracts of InstrumentA and&lt;br&gt;Sell 2 contracts of InstrumentB at market price;&lt;br&gt;If Total Open Profit &gt;= Variable Y then&lt;br&gt;Exit all positions at Market Price; &lt;br&gt;&lt;br&gt;_____________&lt;br&gt;Keep it Simple,&lt;br&gt;&lt;br&gt;Mr. H&lt;br&gt;</description><pubDate>Thu, 02 Aug 2007 17:08:26 GMT</pubDate><dc:creator>Mr. H</dc:creator></item><item><title>Breakout System</title><link>http://www.rightedgesystems.com/forums/Topic3082-9-1.aspx</link><description>Hi Guys,&lt;br&gt;&lt;br&gt;Need a little help on this.&lt;br&gt;&lt;br&gt;I want to make a breakout system that looks for trading ranges and then when they a re broken it will go long or short. See attached screen shot for more info.&lt;br&gt;&lt;br&gt;1. There needs to be at least 4 bars inside one bar range before we can look to take a trade. (Bar 1 on screen shot)&lt;br&gt;2. We then need to save the highest and lowest point of the 4 inside bars. This give us our go long breakout price and short breakout price&lt;br&gt;3. I never know how many bars it will be until we breakout but we always use the range of the fours bars after the wide range bar.&lt;br&gt;&lt;br&gt;The code below is where I got to. The problem is with saving and reseting the high/low values to place a trade.&lt;br&gt;&lt;br&gt;[code]&lt;br&gt;Imports System&lt;br&gt;Imports System.Drawing&lt;br&gt;Imports System.Collections.Generic&lt;br&gt;Imports RightEdge.Common&lt;br&gt;Imports RightEdge.Indicators&lt;br&gt;&lt;br&gt;Public Class SystemMain&lt;br&gt;    Inherits SystemBase&lt;br&gt;&lt;br&gt;    Public Overrides Sub Startup()&lt;br&gt;        ' Perform initialization or set system wide options here&lt;br&gt;&lt;br&gt;        AddHandler PositionManager.OrderFilled, AddressOf OrderFilled&lt;br&gt;&lt;br&gt;        PositionManager.PositionTimeOut = 0&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;    Public Overrides Sub NewSymbolBar(ByVal symbol As Symbol, ByVal bar As BarData)&lt;br&gt;        ' This line of code runs the actions you have set up in in the Project Form&lt;br&gt;&lt;br&gt;        'SystemData.Output.Add(OutputSeverityLevel.Informational, System.Math.Round(LRValue, 4).ToString("N5") &amp; " ~ " &amp; bar.PriceDateTime.ToString)&lt;br&gt;        Dim bars As List(Of BarData) = SystemData.BarCollections(symbol)&lt;br&gt;        Dim pricePane As ChartPane = GetPricePane(symbol)&lt;br&gt;&lt;br&gt;        Static highPrice As Double 'we need to reset these values once a trade is taken&lt;br&gt;        Static lowPrice As Double&lt;br&gt;&lt;br&gt;&lt;br&gt;        If bars.Count &gt; 8 Then ' ensure we have enough bars to proceed&lt;br&gt;&lt;br&gt;            If bars.Item(bars.Count - 4).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 4).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                If bars.Item(bars.Count - 3).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 3).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                    If bars.Item(bars.Count - 2).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 2).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                        If bars.Item(bars.Count - 1).High &lt; bars.Item(bars.Count - 5).High And bars.Item(bars.Count - 1).Low &gt; bars.Item(bars.Count - 5).Low Then&lt;br&gt;                            'if we are here we may want to place a trade&lt;br&gt;                            pricePane.SetBarColor(bar, bar, Color.Orange)&lt;br&gt;                            highPrice = BarUtils.HighestHigh(bars, bars.Count - 4, 4)&lt;br&gt;                            lowPrice = BarUtils.LowestLow(bars, bars.Count - 4, 4)&lt;br&gt;                        End If&lt;br&gt;                    End If&lt;br&gt;                End If&lt;br&gt;            End If&lt;br&gt;&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;&lt;br&gt;        If PositionManager.GetOpenPositions.Count = 0 Then&lt;br&gt;&lt;br&gt;            OpenPosition(symbol, PositionType.Long, OrderType.Limit, highPrice)&lt;br&gt;            OpenPosition(symbol, PositionType.Short, OrderType.Limit, lowPrice)&lt;br&gt;&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;        Actions.RunActions(symbol)&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;    Private Sub OrderFilled(ByVal trade As Trade, ByVal pos As Position, ByVal state As Position.State)&lt;br&gt;        Dim pt As Double&lt;br&gt;        Dim sl As Double&lt;br&gt;&lt;br&gt;        If state = Position.State.Open Then&lt;br&gt;            'Set the TP and SL levels&lt;br&gt;            If PositionType.Long Then&lt;br&gt;                pt = trade.Price + SystemParameters.Item("TP")&lt;br&gt;                sl = trade.Price - SystemParameters.Item("SL")&lt;br&gt;            Else&lt;br&gt;                pt = trade.Price - SystemParameters.Item("TP")&lt;br&gt;                sl = trade.Price + SystemParameters.Item("SL")&lt;br&gt;            End If&lt;br&gt;&lt;br&gt;            PositionManager.SetProfitTarget(pos.PosID, pt, False)&lt;br&gt;            PositionManager.SetStopLoss(pos.PosID, sl, False)&lt;br&gt;&lt;br&gt;        End If&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;End Class&lt;br&gt;&lt;br&gt;[/code]</description><pubDate>Tue, 24 Jul 2007 08:54:26 GMT</pubDate><dc:creator>kaizen</dc:creator></item><item><title>RTD Throughput/Desing Problem</title><link>http://www.rightedgesystems.com/forums/Topic2835-9-1.aspx</link><description>Hello,&lt;br&gt;&lt;br&gt;I hope one of you have found a solution to the following problem before. . . Thanks in advance if you have.&lt;br&gt;&lt;br&gt;I have to implement an interface defined in an external program - I must have a method Notify() in my object toimplement that interface. When there's an update, the Notify() method is called by the external program. I can then collect any updates with a method call that returns a System.Array consisting of an ID (given by me when implementing the connection), and a value.&lt;br&gt;&lt;br&gt;The problem is that the array that I collect updates from is of fixed size (subsequent updates are not added to the end of the array like a queue. . ), so sometimes by the time I've collected the update, set a member variable in another object to the value (m_Object.SomeValue) and returned to respond to any subsequent Notify() calls, the updates have been overwritten and I've missed some updates. . . Not great. I've removed any calculations I was doing in these Set() methods, but it still doesn't return in time. . &lt;br&gt;&lt;br&gt;This is a sample of my set-up:&lt;br&gt;&lt;br&gt;ManualResetEvent m_NotifyEvent;&lt;br&gt;Thread m_UpdateThread;&lt;br&gt;. . . . &lt;br&gt;m_NotifyEVent = new ManualResetEvent(false);&lt;br&gt;m_UpdateTHread = new THread(new ThreadStart(RTDUpdates));&lt;br&gt;m_UpdateThread.Start();&lt;br&gt;... . .. .&lt;br&gt;&lt;br&gt;private void RTDUpdates()&lt;br&gt;{&lt;br&gt;	m_NotifyEVent.WaitONe();&lt;br&gt;&lt;br&gt;	System.Array arrValues = m_RTDServer.RefreshData();&lt;br&gt;	if(arrValues &gt; 0)&lt;br&gt;	{&lt;br&gt;		for (int i =0; i&lt;arrValues.GetLength(1); i++)&lt;br&gt;		{&lt;br&gt;			int[] index1 = {0,i};&lt;br&gt;			int TopicID = Convert.ToInt32(arrValues.GetValue(index1));&lt;br&gt;    			int[] index2 = { 1, i };&lt;br&gt;                        int TopicValue = Convert.ToInt32(arrValues.GetValue(index2));&lt;br&gt;                        switch (TopicID)&lt;br&gt;                        {&lt;br&gt;                            case 0:&lt;br&gt;                                m_Object.BidPrice = TopicValue;&lt;br&gt;                                break;&lt;br&gt;                            case 0:&lt;br&gt;                                m_Object.AskPrice = TopicValue;&lt;br&gt;                                break;&lt;br&gt;                            case 0:&lt;br&gt;                                m_Object.LastPrice = TopicValue;&lt;br&gt;                                break;&lt;br&gt;                            case 0:&lt;br&gt;                                m_Object.LastQuantity = TopicValue;&lt;br&gt;                                break;&lt;br&gt;                        }&lt;br&gt;                }&lt;br&gt;        m_NotifyEvent.Reset();&lt;br&gt;}&lt;br&gt;. . . . &lt;br&gt;&lt;br&gt;public void UpdateNotify()&lt;br&gt;{&lt;br&gt;&lt;br&gt;    m_NotifyEvent.Set();&lt;br&gt;}&lt;br&gt;&lt;br&gt;How can I concentrate on maintaining the proper state of the variables i'm setting by collecting the updates and immediately putting them into some kind of FIFO list. &lt;br&gt;&lt;br&gt;Best regards,&lt;br&gt;&lt;br&gt;Tom.</description><pubDate>Thu, 28 Jun 2007 12:12:12 GMT</pubDate><dc:creator>tobriain</dc:creator></item></channel></rss>