Question - Answer
"... I am writing a custom indicator of gistogramy, how do I do that would, in one case, the raw bar has a single color, and in each other ?..."
As I understood from the letter, if the indicator "hosts" on one condition it risutsya one color if the other (not "pass" for the past), then the other.
To do this we will use both the array indicator. As is known, we can define different arrays, different color, so to display an indicator, we will show its value in one array to another.
if CONDITION SetIndexValue (shift, ind) else SetIndexValue2 (shift, ind2);
"... In my nominee you want to enter the market through a specified number of bars since the conditions of entry, rather it is necessary to do re-scan as it can be done ..."
This point can be done in two ways.
The first method.
As a nominee, the external variable specified time frame to which is attached expert. For example, if the trade is conducted in H1, the variable, eg, timeframe (3600), ie 3600 seconds-1 hour. As a nominee in the fulfillment of the conditions pervnogo keep the current time (t1 = curtime), and then to test the use of such links:
if curtime-t1> timeframe * N then {................
curtime - number of seconds since 0 hours, 1 January 1970.
t1-value curtime N seconds ago
N-number of bars needed
The second way.
The second method is more versatile. The first condition in a variable, for example, Barr kept the current number of bars, bars, Barr = bars.
if Barr + N> = bars then {.......
N-number of bars needed
"... How to make a custom display to show 3 lines? .."
If you ispolzute indicator in a new window, ie, not in the window with the price, it does. MT is currently only supports 2 data set of user indicator.
If the indicator is used in one window with the prices, you can write some (broken down into a few) indicators and use them odnovremmenno.
"... I wrote a custom indicator, it works, but is not in the whole history of quotations. Why ?..."
The point is that complex custom indicators with a serious calculation "suspend" MT. Such indicators may be quite DOT brake, if it occurs, would be appropriate to limit the display indikatra in the last N bars. If you want to test ishoriyu with the use of this indicator, it is better to embed it in an expert.
In any case, limiting the display of the indicator would look like this:
For shift = 0 To Nbars Begin
or so
For shift = Nbars Downto 0 Begin
"... My expert is sometimes a very long time trying to open a position, and sometimes opens immediately. Why does it happen ?..."
The function of the installation warrants, the fourth parameter is the parameter "slippage".
SetOrder (operation, lots, price, slippage, stoploss, takeprofit, color)
It varies the speed and accuracy of performance warrants. Slippage is the maximum allowable slip in order that a warrant would be opened. In a quiet market, for example, for evry possible to use the value of less than 3 points on the U.S. session, better, in my opinion, the use of 3-4 points.
Conclusion
If you have questions about this material, or there are new, be sure to write me and I will try to answer everything.
Halhalyan Arthur
artur@fxtest.ru
artur@fxtest.ru
No comments:
Post a Comment