Trade Assistant: description

27 мая 2023, 11:46
Evgeniy Kravchenko
32
28 091


Installation instructions + demo version


Trade Assistant is a trading panel designed for manual trading. The panel allows you to calculate the risk, manage positions using the Trailing Stop functions, close positions in parts. And other useful features.


List of main features


    risk management

    • Calculates the volume of the transaction, taking into account the established risk and the size of the Stop Loss.
    • Calculates the volume of the transaction, taking into account the commission of the broker and the spread.
    • Displaying the profit of an open position , taking into account the commission of the broker and the spread.
    • The function of setting the ratio of profit to loss.

    Position and order management

    • The panel supports market and pending orders.
    • Trade time manager - opening or closing by time.
    • Closing a position in parts - closes a part of the order as a percentage of the set volume.
    • Trailing Stop - 7 control options   stop loss   order (in points, Fractals, MA, Parabolic SAR, ATR, Partial Close, High Low Bar).
    • Breakeven - moving Stop Loss to the level without loss.
    • Trailing Limit Order - moves a limit order following the market price over a distance.
    • OCO Order - a function to cancel several pending orders when one of them is activated.
    • Virtual Pending Orders.
    • Virtual Stop Loss and Take Profit - Hide SL TP.
    • Closing positions by order type.
    • Closing positions upon reaching the specified profit.

    Graphic panel functions

    • Main panel - contains a tabbed menu for setting up and using functions.
    • Lines function - displays the opening line on the chart,   stop loss   ,   take profit .   With this feature, it is easy to place a new order and see its additional characteristics before opening.
    • Display of open positions and orders - the function shows the opening line,   stop loss   ,   Take Profit with additional useful information.
    • Context menu - allows you to change the settings of the selected order without affecting the settings of other orders.


    How Expert ID works

    The application uses the Expert ID number to identify its positions from other positions. With the default settings, the application manages the positions that were opened with this number. In the input settings, you can change the number to another one or specify 0 so that the application manages positions with any number. When an application is installed on two or more charts with the same Symbol - in this case, a different number must be specified for each application.


    Trade tab


    1. Chart symbol switching function, if there are positions for the current symbol, then it is necessary to enable the "Manage all symbols" function, so that when switching to another symbol, the panel continues to control open transactions of the current symbol and other transactions that are open on other symbols. If you plan to use this feature, make sure that only one panel is used, or other panels have a different EXPERT ID.
    2. Presets - selection of previously saved settings.
    3. Display Active functions
    4. Trade server time, time until the candle close of the current period.
    5. Alert - the function sets an alert line on the chart.
    6. Trade time manager - the function opens/closes trades by time.
    7. Button Hides/Shows the display of trading levels.
    8. The button opens a window for creating a test file in the strategy tester.
    9. The button enables/disables lot calculation.
    10. Lines button - shows lines for marking a future order.
    11. Enter risk - enter the percentage of risk per trade.
    12. Entry - input field for the opening price of a pending order or the distance in points from the market price. To open a pending order in pips, enter the number of pips and click on the open order button (the lines must be disabled).
    13. Enter Stop Loss - if 0 then the position will be set without Stop Loss.
    14. Price button - enables setting parameters in chart prices for Entry, Stop Loss, Take Profit.
    15. Enter Take Profit - if 0 then the position will be set without Take Profit.
    16. Volume input. To open deals with a fixed lot.
    17. Enter an order comment.
    18. Setting the ratio for Take Profit to Stop Loss . Button RR - enables / disables the function.
    19. Display of the current spread and commission. The commission is displayed after calculations. Calculated based on the last trade of the current symbol in history. If there are no transactions for the current symbol in the history, then the commission will not be calculated. The risk percentage shows: the risk of the current symbol / the total risk for all symbols.
    20. Takes a screenshot of the chart, the screenshot is saved to the folder: MQL5 / File / Screenshots.
    21. Close Sell - closes all Sell positions.
    22. Close All - closes all Sell and Buy positions.
    23. Close Buy - closes all Buy positions.
    24. Breakeven - transfers Stop Loss to the level without loss, taking into account the settings of the Breakeven function offset, the function is performed for all positions of the current symbol.
    25. Close % - closes part of the position as a percentage of the volume.
    26. Delete Orders - closes all pending Limit, Stop and virtual orders.


    Line Function

    Marking an order using lines. This function draws entry lines, Stop Loss and Take Profit on the chart, moving these levels can be set to any type of order.

    The lines indicate information with what parameters the future order will be opened, and in the additional parameters you can choose what information will be displayed.


    1. Take profit line.
    2. Open price line.
    3. Stop Loss line.
    4. Button Lock TP SL - locks the line on the price.
    5. R - expand deal type.
    6. Place - button to open a position or order, displayed in the minimized state of the panel.
    7. X - the button removes lines from the chart.

    The opening line is magnetized to the Bid or Ask market price, depending on the order type. You can adjust the magnetization distance using the Magnet to the price parameter in the advanced settings.


    Reward Ratio

    This function automatically adjusts the size of Stop Loss and Take Profit relative to each other. Press the RR button to turn on the function. The screenshot shows an example with 1:2 ratio settings. The function automatically adjusts Take Profit when Stop Loss changes and vice versa when Stop Loss changes, the function adjusts Take Profit.




    Trade Time Manager

    A function to complete trading tasks at the appointed time. To open trades by time, set the order parameters on the Trade panel or using lines. These parameters will be added to the task with which a position or order will be opened.

    In the settings window, you need to select the time, order type and click the add button. Repeat the task by days of the week - enable the days of the week on which the task will be performed at a certain time.

    The close functions are executed considering the "Symbols All, ID all" option on the Close tab, check these options before using.




    Testing

    The testing function allows you to mark trade opening points on the chart in order to use them in the strategy tester to find the optimal settings. The function can use trade history entry points or manually set entry points. The function writes data about entry points to a file and then uses it to open trades in the strategy tester.

    Deal history testing

    Click the Save file button, after that you can test in the strategy tester.

    Testing on marked entry points

    • Sell+ - places a Sell entry point .
    • Bay+ - places a buy entry point .
    • Delete - deletes icons.

    After placing the icons, click the Save File button.





    Tab Close


    1. Closing buttons
    • Close Buy - when clicked, all Buy positions are closed.
    • Close Sell - when clicked, all Sell positions are closed.
    • Close Profit - when pressed, all positions with a profit are closed.
    • Close Loss - when pressed, all positions with a loss are closed.
    • Close All - when clicked, all Buy and Sell positions are closed.
    • Delete Stop - when clicked, all Stop orders are closed.
    • Delete   Limit - when pressed, all Limit orders are closed.
    • Delete All - closes all pending orders.

    2. Profit - shows the total profit in the deposit currency.

    3.% - shows the total percentage of the balance.

    4. Total - shows the amount.

    5. All symbols - adds deals for all symbols to the table and allows you to close them. Only trades that were opened by this application with the same EXPERT ID number (magic number).

    6. All IDs - adds deals with any EXPERT ID number (magic number) to the table and allows you to close them.

    7. "Close all if" - the function closes all market transactions upon reaching the specified profit or loss.

    Example: close all trades if the total profit reaches 100 USD.

    To do this, enter 100 in the Profit field and enable the " Profit>=" button


    Work logic:

    1. On each new tick, the condition is checked: " Total profit" >= 100 ?

    2. If yes: the Close All function is executed;

    "Total profit" - displayed opposite the Close All button.

    Warning! Set the All Characters and All IDs settings before using this feature, and do not change them until the feature is disabled. Since this will affect the "Total Profit" parameter and may lead to the closure of all transactions. Also, do not use this function in conjunction with switching to other characters.


    8. The L buttons are analogous to the "Close all if" function, but more secure, since Stop Loss and Take Profit orders are used for closing. This feature allows you to place stop orders for all open positions of the current symbol.

    Example: close all trades if the total profit reaches 100 USD.

    1. Turn on Button L , set the line at 100 USD.

    2. To place stop orders in this place, press the M button.


    An example of how to close a deal




    Settings tab


    Risk calculation

      • $ Currency - in the deposit currency, the Risk input field (Trade tab) indicates the desired risk in the deposit currency.
      • % Balance - as a percentage of the balance.
      • % Equity - as a percentage of funds.
      • % Free Margin - from the free margin.
      • % Custom - as a percentage of its Custom value.
      • % B prev Day - as a percentage of the previous Day's Balance.
      • % B prev Week - as a percentage of the Balance of the previous Week.
      • % B prev Month - as a percentage of the Balance of the previous Month.


      Spread limit

      A function to limit the opening of a trade if the current spread is greater than the one set in this function.


      Open a position in parts

      The function allows you to open a deal from several parts. In the function settings, you need to specify the lot of one position.

      For example: the lot of the position being opened is 100. But according to the symbol specification, the maximum lot of the position can be only 20.

      Then you need to specify a lot of positions of 20 or less in the function. The function will calculate the number and show on the opening buttons how many positions will be opened in total.


      Manage all Symbols

      A function to manage trades for all symbols. This allows you to trade from a single chart while still using the symbol switching feature.

      When enabling this feature, make sure you have no open trades. If you plan to use two panels or more, be sure to set different EXPERT ID numbers in the input parameters.


      TP SL Line price calculation

      Functions for setting TP SL lines at pre-calculated prices for a specified number of bars on the current chart.

      Period - in bars of the current chart, for calculating the high or low price depending on the direction of the position.

      Indent - added distance in points from the calculated prices for the period.


      Presets

      Function to save panel settings. To save the current settings, enter a name and click save. To load previously saved settings, click on the button with the image "Folders" and select saving.



      Partial closure

      The function is designed to close a part of the deal. This can be useful for partial fixation of profit or loss.



      1. Select the closing lot calculation option.

      • Lot % in - deal closing lot is calculated as a percentage of the initial lot. In the input field of item 4, the percentage of closing is indicated.
      • Lot % - the closing lot is calculated based on the current deal lot. In the input field of item 4, the percentage of closing is indicated.
      • Lot - with this setting, the closing lot is entered in the input field of step 4 .

      2. Select an option to set the closing price.

      • Auto - even placement between the opening price and Take Profit or Stop Loss. Parameters in the input field of paragraph 5 do not need to be set.
      • Point - setting the closing price in points from the order opening price to the closing level. In the input field of item 5, enter the parameters in points.
      • Price - setting the closing price, in input field 5 enter the closing price.
      • RR - setting the closing price relative to the Stop Loss size. In the input field of step 5, enter the ratio to Stop Loss.
      • Change % - setting the closing price as a percentage of the opening price. In the input field of item 5 , specify the % change.

      3. Enable close level to use it.

      4. Enter closing percentage from 1 to 100 or lot (lot cannot be larger than deal lot) . Depends on the setting of item 1 .

      5. Enter the closing price. Depends on the setting of item 2 .

      6. Enable the Partial Closing feature.

      7. Dynamic , levels move after the price. Start - this is the level from which the function starts to work, set in the parameters as the closing level.

      8. Apply - a function to set all panel parameters for the selected position or all positions.


      Dynamic levels

      This option changes the behavior of closing levels. Closing levels follow the price when the price moves away from them and do not move when the price moves towards them.

      Start level - this parameter allows you to delay the activation of this function until the profit of the transaction reaches this level.


      Example:

      Let's enable dynamic levels for SL1 with a closing of 50%, set the start level to 0, so that the levels immediately follow the price.

      And set the start to 200 so that the level follows after reaching the level of 200 points from the opening price.



      Example:

      Let's set up the closing of the transaction by 50% when the profit reaches half of the Take Profit.

      1. Since the transaction should be closed by half, you must select the lot of the transaction, which will be divided by 50%. Let the lot be 0.02, when closing 50%, the deal will have a lot of 0.01.

      2. Lot % in, and Lot % are suitable for this task.

      3. Auto - the method automatically sets TP1 between the open price and the Take Profit price.

      Bottom line: When the market price reaches the level of TP1, the transaction will be closed by 50%.

      Example 2:

      Let's set the closing of the transaction to 50% when the profit reaches the level of 1 RR.

      1. Select the option to set the closing price RR (2p.) in the drop-down menu.

      2. Enter a closing percentage of 50% (4p.)

      3. Enter the closing level in RR 1.00 (5p.)

      4. Turn on TP1 and the partial close function. (3p. 6p.)


      Recommendations for setting up the lot: the lot of the deal should be divided into several parts, if the lot is not enough, the deal will close completely at one of the partial closings. The picture shows an example of such a closure. The deal lot cannot be the minimum lot, since this is the minimum lot and it is not divided into parts for closing.



      Description of parameters and display settings

      • Point - distance in points from the open price to the partial close.
      • Volume (Lot) - closing lot.
      • Risk / profit ratio - the ratio of profit to risk.
      • RR Profit/initial risk - ratio of profit to risk with which a trade was opened.
      • Profit currency - profit of closing this level.
      • % of Balance - profit as a percentage of the balance.

      In the input settings, you can disable or enable the display of these parameters.

      true - enable

      false - disable


      Differences between "Lot% in" and "Lot%" calculations

      As you can see in the screenshot, the percentage setting for the " Lot % in " method is not correct for this method. For this method, it will be correct to set the percentages for all parts of the close so that the total amount of interest is no more than 100%. And for the " Lot % " method, this setting is suitable, since the lot is calculated from the balance of the last closing level to the next one.



      An example of setting up and opening a deal


      An example of how the function works




      Trailing Stop function

      The function controls the Stop Loss order. The task of the function is to move the Stop Loss following the market price, so that if the price returns, the Stop Loss will fix the profit.


      Trailing Stop parameters in points

      • Start - the function starts working when the profit of the deal is greater than this parameter. if 0 then it works immediately.
      • Distance - the main parameter, the distance from the market price to the Stop Loss setting. Indicates at what distance the Stop Loss should be set from the market price.
      • Step - the distance that the market price needs to go to the next Stop Loss setting. if 0 then changes at each point.



      An example of how the function works


      Trailing Stop Fractals

      It works on the Fractals indicator from the standard delivery of the MT4 and MT5 platforms.

      For Buy trades, the Lower Fractal is used.

      For Sell deals, the Upper fractal is used.

      • Start - the function starts working when the profit of the deal is greater than this parameter. if 0 then it works immediately.
      • Timeframes - chart period for indicator calculation.
      • Scan bar - the number of bars on which the last indicator value is searched. The minimum value is 4.
      • Indent - additional indent to the SL level in points.

      An example of how the function works


      Trailing Stop MA

      It works on the Moving Average indicator from the standard delivery of the MT4 and MT5 platforms.

      • Start - the function starts working when the profit of the deal is greater than this parameter. if 0 then it works immediately.
      • Timeframes   - chart period for indicator calculation.
      • Period - indicator calculation period.
      • Method - indicator calculation method.
      • Apply to - prices for calculating the indicator.
      • Indent - additional indent to the SL level in points.

      An example of how the function works


      Trailing Stop Parabolic SAR

      It works on the Parabolic SAR indicator from the standard delivery of the MT4 and MT5 platforms.

      • Start - the function starts working when the profit of the deal is greater than this parameter. if 0 then it works immediately.
      • Timeframes   - chart period for indicator calculation.
      • Step - indicator calculation setting.
      • Maximum - indicator calculation setting.
      • Indent - additional indent to the SL level in points.

      An example of how the function works


      Trailing Stop ATR

      The function uses the calculations of the ATR indicator.

      • Start - the function starts working when the profit of the deal is greater than this parameter. if 0 then it works immediately.
      • Timeframes   - chart period for indicator calculation.
      • period   - indicator calculation period.
      • Coefficient - multiplier.
      • Price High/Low - enables the use of prices of the last closed bar.

      Stop Loss = Price + ATR * Coefficient .

      Price - Bid by default.

      If " Price High/Low " is enabled - for Buy deals - Price = Low , for Sell deals Price = High .


      An example of how the function works


      Trailing Stop by Partial Close

      The function uses the closing levels in parts. Stop Loss is set to the previous close level.

      Example:

      A part of the transaction was closed at the TP1 level - for this level, the previous level is the opening price where you can set a Stop Loss.

      The part of the deal is closed at the level of TP2 - Stop Loss will be set at the level of TP1.

      An example of how the function works


      Trailing Stop High Low prev bar

      The function uses the prices of the last closed bar.

      High - for Sell trades.

      Low - for Buy trades.

      • Start - the function starts working when the profit of the deal is greater than this parameter. if 0 then it works immediately.
      • Timeframes   - chart period for indicator calculation.
      • Distance - distance to Stop Loss.
      • Indent - additional indent to the SL level in points.

      Stop Loss = Price +/- Distance .

      An example of how the function works




      Breakeven function

      The task of the function is to set the Stop Loss in the profit zone, so that if the price returns to the Stop Loss, the transaction will be closed with 0 or with a small profit.


      1. Even Break - function activation parameter.
      2. Offset - parameter for setting Stop Loss relative to the opening price.
      3. "Offset = Spread+Commission" - automatic offset setting, taking into account spread and commission.
      4. Button to select the parameter in which units to use the function:

      • Points - setting in points from the opening price.
      • RR - in relation to Profit/Risk. 1 - RR is equal to Stop Loss.
      • % Price - as a percentage of the opening price.
      • % TP - as a percentage of the TP size.

      Function algorithm:

      • When the profit of the position reaches the level of "Break Even" BE 200, if so, go to 2 points.
      • The function sets the Stop Loss to the "Offset" level of 50 pips from the opening price.

      Function completed. Executed once.

      An example of how the function works


      Trailing Pending Order

      Functions for trailing pending orders by type: Order Limit, Order Stop. The task of the function is to move the order to the market price at a certain distance, for example, 200 points. When the distance from the market price to the order is more than 200 points, the function will move the order to a distance of 200 points from the price. The order does not follow the price when this distance decreases.





      OCO order

      A function to cancel a pending order when another pending order is activated.

      Example: two pending orders "Buy Stop" and "Sell Stop" are set.

      When "Sell Stop" is activated, the function deletes the "Buy Stop" order



      Hide SLTP

      The task of the function is to use virtual trunks and TPs that have the principle of operation exactly the same as that of ordinary ones. The application checks for each new tick the market price and a hidden order, if the price is higher or equal, then an order is sent to close the position. Hidden SLs and TPs execute slower than normal SLs and TPs and slippage can be very large. The speed of execution depends on the speed of execution of the closing order by the broker. This feature only works when the Internet is available and the application is turned on.

      Activation price

      • Ask/Bid - the price depends on the direction of the deal (this is how standard SL and TP work)
      • Ask
      • Bid
      • Mid - average price (Ask+Bid)/2
      • Close - closing price


      Virtual pending order / Virtual pending orders

      A virtual order is opened by the application, unlike regular orders that are opened by a broker. A virtual order allows you to open trades at the selected activation price. Standard orders have an Ask/Bid activation price depending on the direction, but virtual orders can open a trade at a selected price, such as Bid or Close price.

      Activation price

      • Ask/Bid - the price depends on the direction of the deal (this is how standard SL and TP work)
      • Ask
      • Bid
      • Mid - average price (Ask+Bid)/2
      • Close - closing price

      Virtual orders have disadvantages that you should be aware of when using them. Virtual orders are executed slower than regular orders and slippage can be very large. This feature only works when the Internet is available and the application is turned on.





      Поделитесь с друзьями: