Ты уже и здесь успел тему открыть. :)
Сделай так:
Сделай так:
SsMax = High[Highest(MODE_HIGH,SSP,i)]; SsMin = Low[Lowest(MODE_LOW,SSP,i)];
Результат получается абсолютно другой.
Где я ошибся? Или функции Highest && Lowest глючат?
Где я ошибся? Или функции Highest && Lowest глючат?
Эти функции в МТ4 немного изменены - сравните описания, пожалуйста.
Также хочу спросить, появится ли контекстный словарь, как в МТ3? поиск по словарю
Контекстный словать в MetaEditor 4 давно уже есть - нажимайте на F1 или Ctrl+F1. Словарь серьезно расширен по сравнению с MetaEditor 3. Поиск добавлен - увидите в билде 153, который выпустим завтра.
[quote]
Эти функции в МТ4 немного изменены - сравните описания, пожалуйста.
Спасибо, рад, что поиск по словарю будет :))) Я буду самый первый, кто скачает новый билд :)))
а теперь по поводу функций. Я специально переписывал функцию, сверяясь с описанием. Ниже описание для МТ3
type: MODE_OPEN,MODE_LOW,MODE_HIGH,MODE_CLOSE,MODE_VOLUME
beginbar: a shift showing the bar, relative to the current bar, that the data should be taken from
periods: number of periods (in direction from beginbar to the current bar) on which the calculation is carried out
сама конструкция
SsMax = High[Highest(MODE_HIGH,shift+SSP-1,SSP)];
SsMin = Low[Lowest(MODE_LOW,shift+SSP-1,SSP)];
МТ4
int Highest(string symbol, int timeframe, int type, int count, int start)
Returns the shift of the maximum value over a specific number of periods depending on type.
Parameters
symbol - Symbol on that data need to calculate indicator. NULL means current symbol.
timeframe - time frame. It can be any one of the following values:
PERIOD_M1 - 1 minute,
PERIOD_M5 - 5 minutes,
PERIOD_M15 - 15 minutes,
PERIOD_M30 - 30 minutes,
PERIOD_H1 - 1 hour,
PERIOD_H4 - 4 hour,
PERIOD_D1 - dayly,
PERIOD_W1 - weekly,
PERIOD_MN1 - monthly,
0 - time frame used on the chart.
type - =Calculating mode. It can be any one of the following values:
MODE_OPEN - open price,
MODE_LOW - low price,
MODE_HIGH - hight price,
MODE_CLOSE - close price,
MODE_VOLUME - volume, used in Lowest() and Highest() functions.
count - number of periods (in direction from beginbar to back) on which the calculation is carried out. Default WHOLE_ARRAY.
start - a shift showing the bar, relative to the current bar, that the data should be taken from. Default 0.
SsMax = High[Highest(NULL,0,MODE_HIGH,SSP,i+SSP-1)];
SsMin = Low[Lowest(NULL,0,MODE_LOW,SSP,i+SSP-1)];
результат другой, но, опять не то... отличие от МТ3...
Результат получается абсолютно другой.
Где я ошибся? Или функции Highest && Lowest глючат?
Где я ошибся? Или функции Highest && Lowest глючат?
Эти функции в МТ4 немного изменены - сравните описания, пожалуйста.
Спасибо, рад, что поиск по словарю будет :))) Я буду самый первый, кто скачает новый билд :)))
а теперь по поводу функций. Я специально переписывал функцию, сверяясь с описанием. Ниже описание для МТ3
type: MODE_OPEN,MODE_LOW,MODE_HIGH,MODE_CLOSE,MODE_VOLUME
beginbar: a shift showing the bar, relative to the current bar, that the data should be taken from
periods: number of periods (in direction from beginbar to the current bar) on which the calculation is carried out
сама конструкция
SsMax = High[Highest(MODE_HIGH,shift+SSP-1,SSP)];
SsMin = Low[Lowest(MODE_LOW,shift+SSP-1,SSP)];
МТ4
int Highest(string symbol, int timeframe, int type, int count, int start)
Returns the shift of the maximum value over a specific number of periods depending on type.
Parameters
symbol - Symbol on that data need to calculate indicator. NULL means current symbol.
timeframe - time frame. It can be any one of the following values:
PERIOD_M1 - 1 minute,
PERIOD_M5 - 5 minutes,
PERIOD_M15 - 15 minutes,
PERIOD_M30 - 30 minutes,
PERIOD_H1 - 1 hour,
PERIOD_H4 - 4 hour,
PERIOD_D1 - dayly,
PERIOD_W1 - weekly,
PERIOD_MN1 - monthly,
0 - time frame used on the chart.
type - =Calculating mode. It can be any one of the following values:
MODE_OPEN - open price,
MODE_LOW - low price,
MODE_HIGH - hight price,
MODE_CLOSE - close price,
MODE_VOLUME - volume, used in Lowest() and Highest() functions.
count - number of periods (in direction from beginbar to back) on which the calculation is carried out. Default WHOLE_ARRAY.
start - a shift showing the bar, relative to the current bar, that the data should be taken from. Default 0.
SsMax = High[Highest(NULL,0,MODE_HIGH,SSP,i+SSP-1)];
SsMin = Low[Lowest(NULL,0,MODE_LOW,SSP,i+SSP-1)];
результат другой, но, опять не то... отличие от МТ3...
Ты уже и здесь успел тему открыть. :)
Сделай так:
Сделай так:
SsMax = High[Highest(MODE_HIGH,SSP,i)]; SsMin = Low[Lowest(MODE_LOW,SSP,i)];
Спасибо, но не помагает :(((
У меня написано так и работает:
mmin=Low[Lowest(NULL,0,MODE_LOW,per,shift+1)];
Ну забыл я про NULL и 0. :)
Если shift=0 (последний бар), а per=10, то прошерстит с 1-го по 11-ый бар и покажет тот, у которого самый низкий Low в серии из 10 баров.
Спасибо :)
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
Но вопрос у меня прежде всего к разработчикам.
В одном из индикаторов, в МТ3 была такая конструкция:
SsMax = High[Highest(MODE_HIGH,shift+SSP-1,SSP)];
SsMin = Low[Lowest(MODE_LOW,shift+SSP-1,SSP)];
Я переписал её для МТ4:
SsMax = High[Highest(NULL,0,MODE_HIGH,SSP,i+SSP-1)];
SsMin = Low[Lowest(NULL,0,MODE_LOW,SSP,i+SSP-1)];
Результат получается абсолютно другой.
Где я ошибся? Или функции Highest && Lowest глючат? На всякий случай вот код индикаторы в МТ 3 и МТ 4
Метатрейдер 3
/*[[
Name := SilverTrend
Author := Copyright © 2003, VIAC.RU AlexSilver,OlegVS,GOODMAN
Link := http://viac.ru/
Separate Window := No
First Color := Red
First Draw Type := Histogram
Use Second Data := Yes
Second Color := Blue
Second Draw Type := Histogram
Second Symbol := 218
]]*/
Inputs : RISK(3),CountBars(300),SSP(9);
Variables : firstTime(True),shift(0), loopbegin(0);
Variables : smin(0), smax(0), SsMax(0), SsMin(0) ,K(0),val1(0),val2(0);
//SetLoopCount(0);
K=33-RISK;
If firstTime then
{
loopbegin = CountBars;
If loopbegin>(Bars-2*SSP+1) Then loopbegin=Bars-2*SSP+1;
firstTime=False;
};
For shift = loopbegin DownTo 0 Begin
SsMax = High[Highest(MODE_HIGH,shift+SSP-1,SSP)];
SsMin = Low[Lowest(MODE_LOW,shift+SSP-1,SSP)];
smin = SsMin+(SsMax-SsMin)*K/100;
smax = SsMax-(SsMax-SsMin)*K/100;
val1=0;
val2=0;
If C[shift]<smin Then
{val1=High[shift];
val2=Low[shift];
};
If C[shift]>smax Then
{val2=High[shift];
val1=Low[shift];
};
SetIndexValue(shift,val1);
SetIndexValue2(shift,val2);
If shift>0 then loopbegin=loopbegin-1;
End;
Метатрейдер 4
Также хочу спросить, появится ли контекстный словарь, как в МТ3? поиск по словарю?
Спасибо за внимание