Skip to main content

Parameters setting

Adjust the parameter to suit your trading habits.


Example banner

Here, we have listed the adjustable parameters that you can tweak in CosyTrader to suit your trading habits.


Ticket risk management

Define the money you are willing to risk per single ticket.

note

Two stop-loss protection features are provided in this EA:

  1. Close price stop-loss
  2. Float point stop-loss

money-to-risk-per-ticket (Default=10 USD)

This is the amount of money you are willing to risk for each ticket. For example, if you are willing to risk 10 USD for one ticket, set it to 10. The utility will dynamically calculate the lot size based on the distance between the open price and the close price stop-loss. When the price close below your stop-loss, the total loss will be approximately 10 USD (depending on how much the market exceeds the stop-loss price). It helps you control your losses more evenly across trades, ensuring that one losing trade won't wipe out your account.


force-liquidation-fold (Default=2.5x)

It's a paremeter to execute the float point stop-loss. It is a second stop-loss method designed to protect your ticket from excessive losses caused by price fluctuations, particularly in highly volatile market conditions. It automatically closes the ticket if the loss exceeds this threshold, without waiting for the bar to close. For example, if money-to-risk-per-ticket is set to 10 USD and force-liquidation-fold is 2.5x, and the market moves strongly against you, resulting in a floating loss of 10 x 2.5 = 25 USD, the ticket will be closed immediately, even if the bar hasn't closed yet. Keep in mind that this may trigger before the regular stop-loss if you're trading with a large lot size send by yourself, as the floating loss could surpass money-to-risk-per-ticket x force-liquidation-fold.


Ticket entry copilot

Control the features of auto lot size calculation and auto Fibonacci retracement entry.

ticket-entry-copilot (Default=True)

This switch enables ticket entry with automatic lot size calculation and automatic Fibonacci retracement entry. You can turn it off if you prefer to place a pending ticket manually with your desired lot size and without using the automatic Fibonacci retracement entry adjustment feature. It supersedes the dynamic-lot-size-adjustment switch.

ticket-entry-copilotTicket entry function
TrueAuto lot size calculation = True, auto Fibonacci retracement entry = True
FalseAuto lot size calculation = False, auto Fibonacci retracement entry = False

note
  1. The automatic Fibonacci retracement entry will only work with the [C] Fibonacci pending order ticket.
  2. If you want to enter the target Fibonacci retracement level and set the lot size manually, turn off dynamic-lot-size-adjustment instead of ticket-entry-copilot.

dynamic-lot-size-adjustment (Default=True)

This switch controls the automatic lot size calculation (but does not affect the automatic Fibonacci entry). When you turn off dynamic-lot-size-adjustment, you can manually set the lot size for your ticket. The automatic Fibonacci retracement entry will still function if ticket-entry-copilot is set to True. This means that the [C] Fibonacci pending order ticket will dynamically adjust your ticket without changing your lot size. When ticket-entry-copilot is set to True, the function for ticket entry will be:

dynamic-lot-size-adjustmentTicket entry function
TrueAuto lost size calculation=True, auto Fibonacci retracement entry=True.
FalseAuto lost size calculation=False, auto Fibonacci retracement entry=True.

note
  1. The dynamic-lot-size-adjustment will be False when you switch off the ticket-entry-copilot.
  2. You will need to manage the risk yourself with proper lot size calculation if you switch off the dynamic-lot-size-adjustment.

calculate-single-bar-length-breakthrough-risk (Default=True)

Calculates the risk (lot size) by considering the average bar length of specific time frame when the price breaks through your stop-loss point. This is especially useful when using the [A] one bar pending order entry strategy. Trading with a fixed money-to-risk-per-ticket can better control risk; however, when the open price and stop-loss are set within a short distance, the calculated lot size can become extremely large (dividing a number by a very small denominator results in a very large value). This may result in a significant loss when the price penetrates your stop-loss. To prevent this, we designed this feature to account for the breakthrough distance. It calculates the lot size by adding the average bar length of your trading time frame to simulate the bar penetrating through your stop-loss level. Although this slightly reduces the lot size, it provides better protection against excessive losses.


number-of-bars-length-to-be-average (Default=90 bars)

The number of bars to be averaged for calculate-single-bar-length-breakthrough-risk. The average bar length will be calculated based on the latest (most recent) number-of-bars-length-to-be-average. As a result, the average bar length may change slightly over time if the pending order has not been converted to an open order, which may slightly change your pending ticket lot size.

tip

Generally, an average of 60 to 90 bars is a good idea.


lot-size-change-ratio-difference (Default=0.20)

(Value between 0-1, 0.20 = 20%)

This parameter calculates the lot size ratio difference that will trigger a modification of the lot size. For example, a value of 0.20(20%) means the lot size modification will only be triggered when the new calculated lot size is above 120% or below 80% of the original lot size. Since lot size modifications require deleting the original ticket and re-entering a new one in MetaTrader system, this feature is designed to reduce the frequency of ticket re-sending. You can set it to a value between 0 and 1, where 0.2 = 20%.

note

You will see a lot of deleted pending tickets in the history if you set lot-size-change-ratio-difference value too small. (We generally don't think your broker likes you doing that.)

TIP Force a lot size recalculation
  • If you want to force a lot size recalculation, you can switch to a larger time frame (for example, H4 or D1) and then change it back, or switch in the opposite direction. This trick forces a recalculation.

max-lot-size (Default=1.0 lot)

The maximum lot size will be sent. It is a currency/commodity-independent parameter. The calculated lot size will be set to max-lot-size if it is larger than max-lot-size.


retrace-more-when-over-risk (Default=True)

This setting adjusts to a higher pullback ratio when the calculated risk exceeds money-to-risk-per-ticket. For example, if you set your ticket to enter at the retracement ratio of 61.8%, even with the calculated lot size set to the minimum lot size (0.01), it may still result in an excessive loss. It will automatically adjust the entry position by modifying the pullback ratio step by step from 78.6% to 88.6% and then to 98.6% until the calculated lot size no longer causes the risk to exceed money-to-risk-per-ticket or can no longer retrace (at 98.6%). This feature will be useful for users trading with [C] Fibonacci pending tickets with a small money-to-risk-per-ticket.


Time frame

Pick the time frame you commonly use for trading.

default-time-frame (Default=M5)

The default time frame will be set if the user does not provide a time frame code between 1 and 8. For example, if a new ticket is sent with the time frame code set to 0 or 9, the time frame of the new ticket will be set to default-time-frame(you can adjust it manually after your stop-loss is set to something like 0.00002 or 9999.002). This ensures that every pending ticket has its close price time frame. Please set it to the time frame you trade most frequently.


Print the notification text when a new bar has opened and the previous bar has closed. Turn it off if you prefer a cleaner expert advisor output.


Max live ticket

Limit live market tickets to help you stay focused.

restrict-max-live-ticket-number (Default=True)

Some people like to place multiple pending orders and wait for the price to reach them (it’s like fishing with multiple fishing rods). However, once some of the pending orders become real market orders, you may need to focus on just a few of them (it’s like a fish biting the bait on the hook, and you can’t hold multiple rods with just two hands). We designed this feature to help you** automatically delete excess trades** once you already have some live trades in the market, allowing you to concentrate on the number you can handle.

tip

You can set this parameter to an extremely large value if you don't want to use this feature.


max-live-ticket-number (Default=5 tickets)

The maximum number of live tickets you would like to have in the market. You need to set restrict-max-live-ticket-number to True to activate this feature. For example, if you set max-live-ticket-number to 5 and have 10 pending orders in the market, once 5 of them become active market tickets, the remaining pending orders will be automatically deleted. This feature helps you control the number of tickets you can manage.


Low margin protection

Reduce the lot size if you don't have enough margin to trade with your money-to-risk-per-ticket.

set-to-max-suitable-lot (Default=True)

Sometimes, the lot size calculated by money-to-risk-per-ticket may trigger a margin call due to insufficient margin in your account. The low margin protection feature helps reduce the lot size in such situations. We recommend keeping this feature enabled for ticket entry protection. We offer two strategies:

  1. Set to maximum suitable lot size: Gradually reduce the calculated lot size and recalculate it until the account has enough margin to enter and complete the trade (reaching the stop-loss).

  2. Set to minimum lot size: If there isn’t enough free margin for the ticket, it will directly set the lot size to the minimum lot size (0.01 lot for most products).

You can select your preferred method using the set-to-max-suitable-lot parameter. set-to-max-suitable-lot (Default=True) Selection of the low margin handling method with:

set-to-max-suitable-lotLot size calculation method
TrueSet to maximum suitable lot size
FalseSet to minimum lot size

tip

Please check your account conditions and settings manually if you notice the lot size being smaller than expected or hitting the minimum lot size (0.01).


note

Since the lot size will be reduced when your account has low margin, the loss may be less than the money-to-risk-per-ticket. In this situation, you may need to either deposit more funds or reduce the money-to-risk-per-ticket for better lot size calculation.


Ticket update period

Data update frequency of different parameter.

This parameter can be used to set the update interval for the following:

FeatureDescription
Ticket informationUpdate interval for ticket information including open price, stop-loss price, and take-profit prices.
Fibonacci entry price updateAdjustment interval for lot size calculation and the open price of [C] Fibonacci pending order.
Parameter backupInterval for backing up parameters to the disk.

ticket-information-update-period (Default=3 seconds)

This parameter sets the time interval for updating ticket information, including the open price, stop-loss, and take-profit prices. Since a full update is triggered whenever any ticket's OP, SL, or TP is modified, we generally recommend keeping this update interval at the default value.


fibo-entry-price-update-period (Default=20 seconds)

The adjustment interval for updating the open price and lot size of [C] Fibonacci pending orders. Since modifying the lot size requires deleting and resending the pending order, setting this interval too short may cause the ticket to be constantly deleted and resent.


save-backup-file-period (Default=300 seconds)

The time interval for backing up parameters to the disk. Note that the parameters will also be saved to the disk before the EA being closed by the user.


[C] Fibo. entry ticket parameter

Parameter for [C] Fibo. Pending ticket.

number-of-bars-to-search-stoploss (Default=60 bars)

The number of closed bars to search for the time point of the close price for [C] Fibonacci pending tickets. When the user sets the stop-loss and time frame code, CosyTrader will search for the time point of the closed bar with the closest price to the user's stop-loss. This time point will be used as the starting point to find the highest (for buy tickets) or lowest (for sell tickets) price. Both the close price and the highest/lowest price will then be used for retracement price level calculation.

note

The close price time point will be reset when the user adjusts the time frame. Generally, for most of market products, the close price stop-loss bar will be within 60 bars(the default value) if the time frame has been set properly.


Pseudo stpoloss base

Artifact stop-loss price to store time frame code.

Pseudo stop-loss price The pseudo stop-loss price is a placeholder stop-loss used to record the close price stop-loss execution timeframe. It is an extremely distant stop-loss that will be set and displayed after the EA receives the timeframe code sent by the user. The user can modify and resend it to adjust the close price timeframe. Pseudo stop-loss base The pseudo-stop-loss base is the base value for a sell ticket. It is used to set an extremely far fake stop-loss for your ticket (where the close price stop-loss will be stored on the VPS).

note

If you want to adjust the close price stop-loss, please send it as a combination of the (close price stop-loss + TF code) (e.g., 1.00002, 999.003).

Here are the pseudo stop-loss bases parameters for different price levels:

BASE-9 (Default=99.0)

Pseudo stop-loss code for price <9.0


BASE-999 (Default=9999.0)

Pseudo stop-loss code for 99.0<=price <999.0


BASE-9999 (Default=99999.0)

Pseudo stop-loss code for 999.0<=price <9999.0


BASE-99999 (Default=999999.0)

Pseudo stop-loss code for 9999.0<=price <99999.0


BASE-999999 (Default=9999999.0)

Pseudo stop-loss code for 99999.0<=price <999999.0


BASE-9999999 (Default=99999999.0)

Pseudo stop-loss code for 999999.0<=price <9999999.0

note

Pseudo stop-loss base selection is an automated process and independent of the currency or commodities. You only need to adjust it if you find the custom setting cannot be used on your broker's system.


Close price stop-loss switch

Turn off close-price stop-loss for a specific time frame, and switch to a trigger-based stop-loss.

If you don’t want to use the close price stop-loss at a specific time frame, you can simply turn it off. After turning it off, the stop-loss will become trigger-based, meaning it will be triggered when the market price touches it (the same as the commonly used stop-loss).

Close-price-M1 (Default=True)

Switch on/off the close price stop-loss feature for the M1 time frame.


Close-price-M5 (Default=True)

Switch on/off the close price stop-loss feature for the M5 time frame.


Close-price-M15 (Default=True)

Switch on/off the close price stop-loss feature for the M15 time frame.


Close-price-M30 (Default=True)

Switch on/off the close price stop-loss feature for the M30 time frame.


Close-price-H1 (Default=True)

Switch on/off the close price stop-loss feature for the H1 time frame.


Close-price-H4 (Default=True)

Switch on/off the close price stop-loss feature for the H4 time frame.


Close-price-D1 (Default=True)

Switch on/off the close price stop-loss feature for the D1 time frame.


Font setting

Font setting for the table content.

Font (Default = Consolas)

Font of the table text. Please choose a** monospaced typeface** for better text alignment.


Font-size (Default = 13)

Font size of the table text.


Font-color (Default = ‘C’223,93,61’)

Font color of the table text.


Setting for menu button and table displaying.

(Value between 0~1)

The vertical position of the menu button (hamburger button) indicates that 0.2 means the menu button is displayed at 20% of the vertical direction.


first-label-text-vertical-shift (Default=30 pixels)

The vertical gap between the menu button and the first line text.


label-text-line-distance (Default=30 pixels)

The vertical gap between each line in the table