Other News

How do I set a Trailing Stop?


How do I set a Trailing Stop?

VTS has a two ways to set a trailing stop.  

 

(1)

The easiest is on the configuration window for fnOpenOrder function: It’s just a checkbox.

You can set the trial to an offset, like 20, 30, etc. Or you can set it to a price value like the Low of the last candle.

 

(2)

You can drag and drop the function fnTrailingStop (In the Functions Toolbox, under the Trade menu) and connect in your drawing where you want the trail to execute.



 

RAQ

How do I delete a pending order?


How do I delete a pending order?

How do I delete an order after it has been open for 5 candles.

 

A. 
In the VTS Functions Toolbox, under Trade->MQL, use the MQL function “OrderDelete” to delete a pending order.

 

To delete after 5 bars, save the MQL variable “Bars” into a new Variable (one that you drag and drop).

The MQL builtin variable “Bars” is a running count of each bar on a chart, where the latest forming bar is the highest number (like 344). The bar on the chart before it (to the left) would be bar # 342.

 

Suppose you name your variable “mybars”. The key is to only set “mybars” once, at the same time that you create the pending order. Then create logic that states:

if:  Bars is greater or equal to mybars + 5

then: delete the pending order

How do I delete a pending order?

How do I delete an order after it has been open for 5 candles.

 

A. 
In the VTS Functions Toolbox, under Trade->MQL, use the MQL function “OrderDelete” to delete a pending order.

 

To delete after 5 bars, save the MQL variable “Bars” into a new Variable (one that you drag and drop).

The MQL builtin variable “Bars” is a running count of each bar on a chart, where the latest forming bar is the highest number (like 344). The bar on the chart before it (to the left) would be bar # 342.

 

Suppose you name your variable “mybars”. The key is to only set “mybars” once, at the same time that you create the pending order. Then create logic that states:

if:  Bars is greater or equal to mybars + 5

then: delete the pending order

RAQ