Articles by: David Williams

Custom Indicator that output dots and crosses

Q: My indicator outputs round dots and crosses. Where can I find a solution to implement this indicator?

A: These kinds of things written onto a MetaTrader chart are called “objects”.  MT defines many object types such as thumbs, arrows, dots, etc.

The best way to work with these kinds of indicators is to use the functions “fnGetObjectByType” or “fnGetObjectByName”. These are found in the Functions toolbox under the “Chart Objects” menu. (They are part of the Chart Object Plug-in)

Create a simple EA that uses these functions and writes the values to the chart (use the Message tab) to see how and when the custom indicator writes the objects. Once you understand that, you can use the info within the logic of your EA for opening/closing trades. 

Video

Here is a link to a video showing how to configure a simple MT custom indicator. It’s an older version of VTS, but the configuration is exactly the same.

RAQ

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