Smart Trading Apps: Market Entry App User Guide Below User Guide uses the Market Entry App with three profit taking limit stages as an example. All other Market Entry App versions are functionally identical just using more or less profit taking limit levels and corresponding partial positions sizes. FIFO accounts are currently not supported. IMPORTANT NOTE: You are strongly recommended to learn to correctly use this App on a demo account first! It is the user s sole responsibility to use this App on a real account, which implies the risk to lose the entire equity of the account according to the chosen parameters, see also the risk and software disclaimers at the bottom of this document. The terms App and Strategy designate the same program structure in below description. Importing the App To import the App, you need to save it in a suitable directory on your computer or on the Desktop for easy access. The App has to be imported into the Trading Station II program. This is done under Charts -> Alerts and Trading Automation -> Import Extensions. In the following menu, browse the App to locate it in the directory where you saved it before. When you have selected the App, click in the following window on Install. A detailed documentation of the Import Process of the recent version of Trading Station II can be also found at http://fxcodebase.com/code/viewtopic.php?f=29&t=602 Executing the App After a successful Import of the App, you are ready to use it. You need three steps to do this. Under Charts -> Alerts and Trading Automation -> New Strategy and Alert will open up a list to select a strategy. You App should be in this list now:
You need to select the App which is called MarketEntryApp_3Stages and click on OK. You may need to scroll down to the bottom of the list before the first time you start it. Afterwards, it will be at the top of the list in the sub-list of Recent : This will open up the User Menu of the App. Upon purchase of a life-time license, you can define the default values of all parameters to your preferred choice, such that you only have to select the instrument and the direction of the position to use the App in an easy way.
The App User Menu looks like this: The following parameters have to be selected (unless you are fine with the default values): Symbol: The instrument to trade and open a position thereof. Direction: Buy to open a long position, Sell to open a short position. License: Input your license string. ClosePositionAtWeekend: If Yes is selected, a position still open at 16:45 NYT on a Friday will be automatically closed (this is 15 minutes before Forex instruments market closing). If No is selected, an open position is left open over the weekend. ContextReloadMaxTimeDifference: Maximum time difference between a Position Storage and Position Reloading. The time difference is to be input in the OLE format, default value is 7 days.
The App automatically stores position data of an open position in a database file when stopping the App. When starting up the App, it automatically checks whether it finds stored position data in the database file which is not older than defined by the parameter. If it finds valid position data, it continues to execute the exit management of this position, provided it is still alive in the account (i.e. it has not been closed in the meantime). If there is no valid position data, the App will open a new position. This allows performing position exit management over very long time periods, even over weekends, and also covers Trading Station II platform network losses and re-connects. AllowTrade: Always set to Yes to allow the App to trade. If set to No, the App cannot execute any order command. AccountID: Select an Account from the account list which a position is to be managed for. UseOutputMessaging: Set to Yes if you want to receive E-Mail messages regarding the position management, e.g. when reaching a profit taking limit or detecting a position exit triggered by hitting the StopLoss price level. Email: The E-Mail address to receive the App messages. NOTE: You need to have an E-Mail account configured to have TradeStation II send E-Mails for the account selected. Use the E-Mail configurator to do this, which is available at http://www.fxcodebase.com/code/viewtopic.php?f=31&t=23349 SendStatusMail: Additionally to the position management E-Mail messages, you can have the App send every hour a status E-Mail indicating that the App is running and informing about price movements. Select Yes to enable this option, or No if you do not want receive hourly status messages. MovingLimitDistance_in_PIPS: Set the number of PIPS distance of a protective limit bracket order for the entire position size, which is above the real next profit taking limit level to be closed out for long positions and below the real next profit taking limit level to be closed out for short positions. It is recommended to use a value in the range of 25-50 for volatile market conditions. If the protective limit bracket order is beyond the very last Limit level (the third level in this case), the very last Limit level is chosen instead. This protective limit bracket order shall ensure that a profit can be realized for the position left at any point in time in case that the network connection is lost or Trading Station II stops working. Please note that the Limit level of the protective limit bracket order is visible in the Trading Station window of Open Positions. Unless the Limit order shown there is for the last profit taking limit stage of the position, it may thus be at a level which is NOT the next profit taking limit level you expect. DynamicRiskManagement: Set to Yes if you want to determine the entire position size by a risk percentage of your account size below. Set to No, If you want to define the entire position size by a number of lots below. In both cases, the entire position size takes into account the initial StopLoss PIPS distance selected below.
Risk_per_trade_in_PERCENT: If DynamicRiskManagement is set to Yes, the percentage of the account size depending on RiskMode below determines the size of the entire position. RiskMode: Select Equity for the risk percentage of the Account Equity, select Balance for the risk percentage of the Account Balance, or select Margin for the risk percentage of the Account Margin to define the entire position size. Example: DynamicRiskManagement is set to Yes, Risk_per_trade_in_PERCENT percentage is set to 1.0, and RiskMode is set to Equity. In this configuration, the entire position site is set such that when hitting the initial StopLoss PIPS distance, one percent of the available account equity will be lost. NOTE: There will always be rounding effects of the entire position size since an integer number of lots must be used. The lot size depends on your account type. NumberOfLots: If DynamicRiskManagement is set to No, an integer number of lots has to be input which determines the size of the entire position. Limit1_TradePercentage: The percentage of the position size for the first profit taking limit level. Limit2_TradePercentage: The percentage of the position size for the second profit taking limit level. NOTES: The percentage of the position size of the third profit taking limit level is 100% - Limit1_TradePercentage Limit2_TradePercentage. Due to rounding effects using lots, the actual partial position sizes corresponding to individual profit taking limit levels will deviate from the theoretical value. If the risk percentage of the chosen account size is not sufficient to fill all the partial position sizes with the desired number of lots, the uppermost profit taking limit levels will remain unfilled, having the consequence that the App will execute less profit taking limit levels than expected for a successful trade. StopLoss_in_PIPS: Initial Stop Loss Level defined as a PIPS distance from the entry price. BreakEvenLevel_in_PIPS: Profit Level defined as a PIPS distance from the entry price which triggers to move the initial StopLoss level to Break-Even, independent of reaching any of the profit taking limit levels. Set this parameter to a positive integer number lower than Limit1_in_PIPS if you want a Break-Even protection before reaching the first profit taking limit level. Otherwise, set to zero to disable the early Break-Even feature. BreakEvenOffset_in_PIPS: Defines a PIPS offset around the entry price as the Break-Even Stop level, i.e. the Stop level is moved to the price level of (Entry Price + BreakEvenOffset_in_PIPS) for a long position and (Entry Price - BreakEvenOffset_in_PIPS) for a short position. A positive number will result in a profit, a negative number in a loss, a setting of zero will define the entry price level as the Break-Even Stop level.
Limit1_in_PIPS: The PIPS distance between the entry price and the first profit taking limit level. NOTE: Reaching the first profit taking limit level will move the initial StopLoss level to Break-Even, if not yet done by having set BreakEvenLevel_in_PIPS to a smaller value. Limit2_in_PIPS: The PIPS distance between the entry price and the second profit taking limit level. NOTE: Reaching the second profit taking limit level will move the Stop level from Break-Even to the first profit taking limit level. Limit3_in_PIPS: The PIPS distance between the entry price and the third profit taking limit level. NOTE: Reaching the third profit taking limit level will close the position finally.
Market Entry Apps with Stop Trailing If you use a Market Entry App which supports any of the Stop Trailing Methods, there are further parameters for defining the Stop Trailing execution. A Market Entry App with Stop Trailing leaves the last profit taking limit level open. This means that for a single-stage Market Entry App, there is no Limit level defined, it will just trail the Stop level of the position according to the user configuration. If you use e.g. a triple-stage Market Entry App, there are two profit taking limit levels defined and the third Limit level is left open. Do note that the Stop Trailing is executed in addition with the Stop Movements taking place along multiple profit taking limit levels. This means that you can define to start Stop Trailing after having reached the second profit taking limit level (which probably represents the default case), but is also possible to start Stop Trailing earlier depending on the setting of the parameter TrailingStopTriggerLevel_in_PIPS below. All Stop Trailing methods have two parameters in common: TimeFrame: The time frame of the price series which the Stop Trailing Indicator or Price Level will be derived from, depending on the chosen Stop Trailing Method. TrailingStopTriggerLevel_in_PIPS: Profit level in PIPS distance from the Position Entry Price which needs to be reached to start off the Stop Trailing execution. NOTE: Long positions derive prices and indicator from the Bid price series. Short positions derive them from Ask price series. The Stop Trailing method dependent parameters are: Fixed Distance from Best Price: TrailingStopDistance_in_PIPS: PIPS distance between Stop Level and best price. TrailingStopDistance_PriceSeries: High, Low, Open, Close to determine the best price Fixed Retracement Percentage from Best Price: TrailingStopRetracementPercentage: Percentage of retracement from best price. TrailingStopDistance_PriceSeries: High, Low, Open, Close to determine the best price ATR Distance from Best Price: ATR_Multiplier: Multiplier of ATR value to determine PIPS distance of Stop Level of Best Price ATR_PriceSeries: High, Low, Open, Close to determine the Best Price ATR_Length: Length of ATR Indicator Parabolic-SAR: SAR_Step: Parabolic SAR Indicator Step Size SAR_Max: Parabolic SAR Indicator Sensitivity
Fixed Distance from Best Fractals: TrailingStopFractalsOffset_in_PIPS: PIPS distance from Best Fractal
Sample Trade on Dow Jones Index US30: The following is an example on how to use the Market Entry App with thee Profit Taking Limit Stages as used in a sample trade on a FXCM demo account. The parameters are exactly the same as shown in the User Menu figure above. The Position Management in this App uses a short position ( Sell ) with three profit taking levels of 10, 20, and 30 PIPS. The initial StopLoss distance is 30 PIPS. BreakEvenLevel_in_PIPS is zero, i.e. the Break-Even protection takes place reaching the first Limit level of 10 PIPS. NOTE: If this parameter had been set to e.g. 5, the Break-Even Stop Move would have been executed at a profit level reaching 5 PIPS before reaching the first profit taking limit level of 10 PIPS. BreakEvenOffset_in_PIPS is zero, which means that the Break-Even protection is set to the exact entry price. The App will open a position of a size which will lose 1% of the available account equity if the StopLoss of 30 PIPS is hit, since the DynamicRiskManagement is set to Yes. You will see below, that 11 lots were opened in this sample trade. Due to rounding effects, you will notice below that the first partial position size of 50% is set to 6 lots, since you cannot trade 5.5 lots (it has to be an integer value). The second partial position size of 30% is set to 3 lots, which leaves the remaining third partial position size (which represents 20% of the entire position) at 2 lots. NOTE: If DynamicRiskManagement had been set to No, the App would have taken the input value of the parameter NumberOfLots (which is set to 10 lots). Position Management of the sample trade: Upon opening of the short position with 11 lots with an entry price level of 14664, the attached Stop and Limit bracket orders are set as follows: StopLoss level is 30 PIPS above the entry price as configured, which amounts to 14664 + 30 = 14694. The first profit taking limit distance is 10 PIPS. The protective Limit order level is at 10 PIPS plus 25 PIPS set as MovingLimitDistance_in_PIPS, which yields 35 PIPS. As this value is already greater than the last profit taking limit distance of 30 PIPS, the protective distance is chosen as the minimum of these two values, which is 30 PIPS. Therefore, the attached Limit order has a price level set to 14664 30 = 14636. Remember that this is a protective Limit order. It does not represent the price level to be closed out next! The trade reaches the first profit taking limit level of 10 PIPS, which is at 14664 10 = 14654, where 6 lots are closed out. Additionally, the Stop level is moved to Break-Even price level of 14664. The Limit
level will stay at the 14636, since the protective Limit level of the second Limit level and MovingLimitDistance_in_PIPS will be again beyond the last Limit level as already explained for the initial Limit level above. The trade then reaches the second profit taking limit level of 20 PIPS, which is at 14664 20 = 14646, where 3 lots are closed out. Additionally, the Stop level is moved to the first profit taking limit level of 14664 10 = 14656, and the Limit level is set to the real third profit taking limit level, since it is the last profit taking limit level of the entire position. NOTE: In our example, it was already set to this level before, since the profit taking limit levels are close together and in the range of MovingLimitDistance_in_PIPS value. The trade does not reach the third profit taking limit level of 30 PIPS, but hits the Stop level of 10 PIPS (the first profit taking limit level) instead, which finally closes the position. The corresponding Email Messaging of the sample short position on US30 instrument with time information: 19:12 Initialisation of MarketEntry 3 Limit Stages US30 H1 Strategy of US30 Instrument. The Account Equity is 29604.65. The Account Balance is 29604.65. MarketEntry 3 Limit Stages US30 H1 Strategy of Instrument US30 of H1 time frame: Market Entry Order Triggered for Position: MarketEntry 3 Limit Stages US30 H1_US30_H1_S. Desired entry price is 14664.00000.
Market Entry Order for short position of MarketEntry 3 Limit Stages US30 H1 Strategy of Instrument US30 of H1 time frame successfully processed. Market Entry Order of MarketEntry 3 Limit Stages US30 H1 of instrument US30 of H1 time frame has opened short position of amount 11 being equal to 11 lots of H1 time frame. StopLoss Distance is 30 PIPS. First Limit Distance is 10 PIPS. Slippage is 0.0 PIPS. Account Equity is 29561.76. 20:00 MarketEntry 3 Limit Stages US30 H1 Strategy is running. Ask Price Bar Stream of H1 time frame updating. High Price is 14676.00000, Low Price is 14659.00000, Open Price is 14674.00000, Close Price is 14669.00000. 20:31 Triggered Market Exit Order to close out a position or a part thereof. Short Position of US30 of MarketEntry 3 Limit Stages US30 H1 Strategy of H1 time frame: 1. Limit Price Level reached. Close out 6 lots of the position. Position or part of a position successfully closed. 95575932 Short Position of US30 of MarketEntry 3 Limit Stages US30 H1 Strategy of H1 time frame: Triggered modification of Stop Order of open position. 1. Limit Price Level reached. Move StopLoss to Break-Even of 14664.00000 to protect the position. Triggered modification of Limit Order of open position. 1. Limit Price Level reached. Move Limit to 2. Limit Level of 14644.00000. Stop Order of open position successfully modified. Limit Order of open position successfully modified. 20:35 Triggered Market Exit Order to close out a position or a part thereof. Short Position of US30 of MarketEntry 3 Limit Stages US30 H1 Strategy of H1 time frame: 2. Limit Price Level reached. Close out 3 lots of the position. Position or part of a position successfully closed. 95576118 Short Position of US30 of MarketEntry 3 Limit Stages US30 H1 Strategy of H1 time frame: Triggered modification of Stop Order of open position. 2. Limit Price Level reached. Move StopLoss to 1. Limit level of 14654.00000 to protect the position. Triggered modification of Limit Order of open position. 2. Limit Price Level reached. Move Limit to 3. Limit Level of 14634.00000.
Stop Order of open position successfully modified. Limit Order of open position successfully modified. 20:37 MarketEntry 3 Limit Stages US30 H1 Strategy Trade Exit of Instrument US30 of short position of H1 time frame entered at Server Time of 02.04.2013 13:12 and Local Time of 02.04.2013 19:12. Entry Price was 14664.00000. Exit Ask price estimated by current Ask price is 14654.00000. Position exit having reached 2 profit levels out of 3 total profit levels. Account Equity is 29713.86. Risk Disclaimer Trading Foreign Exchange (Forex), Contracts For Difference (CFDs), or other financial products, carries a high level of risk, and may not be suitable for all investors. Before deciding to invest you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading, and seek advice from an independent financial advisor if you have any doubts. Software Disclaimer and Licensing Copyright 2013 Martin Streckfuß. All rights reserved. THIS SOFTWARE IS PROVIDED BY Martin Streckfuß ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Martin Streckfuß OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. You are not permitted to resell, repackage or otherwise distribute this software in source or binary forms without written permission from the author(s).