MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading and Strategy Testing Forum

Hidden TP and SL LimitedHidden TP and SL Limited Try product
Hidden TP and SL Limited
Author: song_song
Screenshot
SILVER., H4
Real
Subscribe to signal
Miracle 57
135.14%, 107.30 USD
MQL5 Wizard - Trade Signals Based on Dark Cloud Cover/Piercing Line + Stochastic Expert Advisor
MQL5 Wizard - Trade Signals Based on Dark Cloud Cover/Piercing Line + Stochastic
Author: MetaQuotes
Visualize a Strategy in the MetaTrader 5 Tester Visualize a Strategy in the MetaTrader 5 Tester

// Examples for subclassed trendline?

To add comments, please log in or register
z3tr4d3r
29
z3tr4d3r 2012.06.07 22:14 

Hello all,

aiming to create an indicator that basically consists of a trendline displaying text at its ends. RayRight and RayLeft should be prohibited (easy). The handling should be just as if it was a regular trendline (difficult).

My questions at the moment are as follows:

1) Which time/price values can I use when applying the indicator to the chart? I.e. how shall I get an initial value so the line is created within a visible area of the chart?

2) How would I plot the text to the ends? 

 

Any examples are very appreciated - couldn't find something at mql5 at all (though the article  "Designing and implementing new GUI widgets based on CChartObject class" uses trendlines as the general example, but unfortunately doesn't show how to do something with trendlines)!

 

Thanks very much and so long, 

z3tr4d3r 

onewithzachy
961
onewithzachy 2012.06.14 10:27  
z3tr4d3r:

Hello all,

aiming to create an indicator that basically consists of a trendline displaying text at its ends. RayRight and RayLeft should be prohibited (easy). The handling should be just as if it was a regular trendline (difficult).

My questions at the moment are as follows:

1) Which time/price values can I use when applying the indicator to the chart? I.e. how shall I get an initial value so the line is created within a visible area of the chart?

2) How would I plot the text to the ends? 

Any examples are very appreciated - couldn't find something at mql5 at all (though the article  "Designing and implementing new GUI widgets based on CChartObject class" uses trendlines as the general example, but unfortunately doesn't show how to do something with trendlines)!

Thanks very much and so long, 

z3tr4d3r 

Hi z3tr4d3r ,

1. The price value can come from the CI itself. It depend on the CI then, what CI you going to use or what are the base/the data source of your CI ?. and the time value is always bar time value.  You can use FirstVisibleBar() (and perhaps also VisibleBars() ) then recalculate so that the trendline (or part of the trendline) will be drawn on visible area of the chart.

2. Create separate Object Text at the end of the trendline, or ... good luck :).

:D 

/
To add comments, please log in or register