Доработка ботов (советников, индикаторов) vol. 2

stargazer2011

Местный житель
Уважаемые господа программисты!
Добавьте, пожалуйста, к этому советнику функцию закрытия ВСЕХ открытых этим советником сделок (сетки бай и селл) по общему профиту в валюте депозита. Спасибо за Вашу помощь!
 

Вложения

  • VR Smart Grid Lite M1.mq4
    24,7 КБ · Просмотры: 35

druzhba78

Активный участник
Здравствуйте, коллеги! Помогите, пожалуйста, с индикаторами. Необходимо вывести в настройки регулировку истории, чтобы не было чрезмерной нагрузки на терминал.
 

Вложения

  • TMA centered MACD v.1 MTF TT.mq4
    23 КБ · Просмотры: 35
  • Vip Heiken Ashi histo mtf.mq4
    7,4 КБ · Просмотры: 46

Аввакум2

Гуру форума
подскажите пожалуйста, можно ли внести изменения, чтобы кроме названия индикатора в настройках можно было задавать также и параметры индикатора (через "/", а там где false/true - ставить 0 или 1 соответственно)?

Чтоб осуществить такие требования, это под каждый индикатор формата ех надо писать индивидуальную прокладку. Иначе никак. Если за это дело и кто-то возьмётся, то, скорее всего, на платной основе.
 

wintrades

Новичок форума
Чтоб осуществить такие требования, это под каждый индикатор формата ех надо писать индивидуальную прокладку. Иначе никак. Если за это дело и кто-то возьмётся, то, скорее всего, на платной основе.
думаю конечно не под все индикаторы, но под некоторые хотя бы... сделал такой вариант с возможностью вносить параметры (посмотрел как в другом индикаторе и добавил по аналогии)...
Добавил во внешние параметры:
_O_iCustomPara
И в код:
void PrepareOpenParameters() {
string tmp[];
StringSplit(_O_iCustomParam,'/',tmp);
}
Посмотрите пожалуйста, вроде работает, но может что-то необходимо подправить?...
 

everton13

Интересующийся
Would it be possible to convert this code from a Thinkorswim indicator to MT4 ... Or does anyone have an indicator similar to this?

1584381215235.png

shared_shared_Fractal_Modified_bottom_alerts


CODE :

#
#
#This script will show support and resistance lines based on either
# user-defined price pivots, or automatically based on pivot points
# calculated by the script. In the case of automatic determination, only
# the last two matching points are used.
#hint numBars: For automatic pivot calculation: How many bars to use in calculation of pivotPoints. ie. current high is higher than both prior X bars and following X bars
#hint showLines: Show a line extending from high and low price pivots
#hint showValues: Show the numeric value of price occurring at the pivot point
#hint showBarNumbers: For manually entered pivots: used to determine bar numbers for two price pivot points to connect. It is recommended to temporarily turn off showValues.
#hint TrendResistanceStart: Starting point of a resistance trend line (connecting the highs), entered as a bar number. It is recommended to turn on showBarNumbers temporarily to determine the value.
#hint TrendResistanceEnd: Ending point of a resistance trend line, entered as a bar number. It is recommended to turn on showBarNumbers temporarily to determine the value.
#hint TrendSupportStart: Starting point of a support trend line (connecting the lows), entered as a bar number. It is recommended to turn on showBarNumbers temporarily to determine the value.
#hint TrendSupportEnd: Ending Point of a support trend line (connecting the lows), entered as a bar number. It is recommended to turn on showBarNumbers temporarily to determine the value.
input numBars = 5;
input showLines = yes;
input showValues = yes;
input showBarNumbers = no;
input TrendResistanceStart = 0;
input TrendResistanceEnd = 0;
input TrendSupportStart = 0;
input TrendSupportEnd = 0;

def UserSetResistance = TrendResistanceStart > 0 and TrendResistanceEnd > 0;
def UserSetSupport = TrendSupportStart > 0 and TrendSupportEnd > 0;
def currentHigh = high;
def currentLow = low;
def currentBar = BarNumber();
def PH;
def PL;
def isHigherThanNextBars = fold i = 1 to numBars + 1 with p = 1
while p do currentHigh > GetValue(high, -i);
PH = if UserSetResistance and ( currentBar == TrendResistanceStart or currentBar == TrendResistanceEnd ) then currentHigh else if !UserSetResistance and (currentBar > numBars and currentHigh == Highest(currentHigh, numBars) and isHigherThanNextBars) then currentHigh else Double.NaN;
def isLowerThanNextBars = fold j = 1 to numBars + 1 with q = 1
while q do currentLow < GetValue(low, -j);
PL = if UserSetSupport and ( currentBar == TrendSupportStart or currentBar == TrendSupportEnd ) then currentLow else if !UserSetSupport and (currentBar > numBars and currentLow == Lowest(currentLow, numBars) and isLowerThanNextBars) then currentLow else Double.NaN;
rec PHBar = if UserSetResistance then TrendResistanceEnd else if !IsNaN(PH) then currentBar else PHBar[1];
rec PLBar = if UserSetSupport then TrendSupportEnd else if !IsNaN(PL) then currentBar else PLBar[1];
rec PHL = if !IsNaN(PH) then PH else PHL[1];
rec priorPHBar = if UserSetResistance then TrendResistanceStart else if PHL != PHL[1] then PHBar[1] else priorPHBar[1];
rec PLL = if !IsNaN(PL) then PL else PLL[1];
rec priorPLBar = if UserSetSupport then TrendSupportStart else if PLL != PLL[1] then PLBar[1] else priorPLBar[1];
def isFinalTwoHighPivots = currentBar >= HighestAll(priorPHBar);
def isFinalTwoLowPivots = currentBar >= HighestAll(priorPLBar);
def ResistanceFinishOffset = if isFinalTwoHighPivots then currentBar - PHBar else 0;
def ResistanceStartOffset = if isFinalTwoHighPivots then currentBar - priorPHBar else 0;
def ResistanceSlope = (GetValue(PH, ResistanceFinishOffset) - GetValue(PH, ResistanceStartOffset)) / (PHBar - priorPHBar);
def SupportFinishOffset = if isFinalTwoLowPivots then currentBar - PLBar else 0;
def SupportStartOffset = if isFinalTwoLowPivots then currentBar - priorPLBar else 0;
def SupportSlope = (GetValue(PL, SupportFinishOffset) - GetValue(PL, SupportStartOffset)) / (PLBar - priorPLBar);
rec ResistanceExtend = if currentBar == HighestAll(PHBar) then 1 else ResistanceExtend[1];
rec SupportExtend = if currentBar == HighestAll(PLBar) then 1 else SupportExtend[1];

plot pivotHigh = if
#isFinalTwoHighPivots
ph>0 then PH else Double.NaN;
plot pivotHighLine = if PHL > 0 and isFinalTwoHighPivots then PHL else Double.NaN;

plot ResistanceLine = pivotHigh;
plot ResistanceExtension = if ResistanceExtend then (currentBar - PHBar) * ResistanceSlope + PHL else Double.NaN;
plot pivotLow = if
#isFinalTwoLowPivots
pl>0 then PL else Double.NaN;
plot pivotLowLine = if PLL > 0 and isFinalTwoLowPivots then PLL else Double.NaN;
plot SupportLine = pivotLow;
plot SupportExtension = if SupportExtend then (currentBar - PLBar) * SupportSlope + PLL else Double.NaN;
plot BN = currentBar;
plot PivotDot = if !IsNaN(pivotHigh) then pivotHigh else if !IsNaN(pivotLow) then pivotLow else Double.NaN;
plot BisectLine = if !isNaN(pivotHigh) then pivotHigh else if !isNaN(pivotLow) then pivotLow else double.NaN;
pivotHigh.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
pivotHigh.SetHiding(!showValues);
pivotLow.SetDefaultColor(GetColor(4));
pivotLow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
pivotLow.SetHiding(!showValues);
ResistanceLine.EnableApproximation();
ResistanceLine.SetDefaultColor(GetColor(7));
ResistanceLine.SetStyle(Curve.SHORT_DASH);
ResistanceExtension.SetStyle(Curve.SHORT_DASH);
ResistanceExtension.SetDefaultColor(GetColor(7));
SupportLine.EnableApproximation();
SupportLine.SetDefaultColor(GetColor(7));
SupportLine.SetStyle(Curve.SHORT_DASH);
SupportExtension.SetDefaultColor(GetColor(7));
SupportExtension.SetStyle(Curve.SHORT_DASH);
pivotHighLine.SetPaintingStrategy(PaintingStrategy.DASHES);
pivotHighLine.SetHiding(!showLines);
pivotLowLine.SetPaintingStrategy(PaintingStrategy.DASHES);
pivotLowLine.SetHiding(!showLines);
BisectLine.EnableApproximation();
BisectLine.SetLineWeight(2);
PivotDot.SetDefaultColor(GetColor(7));
PivotDot.SetPaintingStrategy(PaintingStrategy.POINTS);
PivotDot.SetLineWeight(3);
BN.SetDefaultColor(GetColor(0));
BN.SetHiding(!showBarNumbers);
BN.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
#Alert(close crosses below SupportExtension*1.0010 or close crosses above SupportExtension*.9985, "Nearing Support", Alert.Bar, Sound.bell);


1584381266720.png
 

Вложения

  • a.png
    a.png
    34 КБ · Просмотры: 294

Аввакум2

Гуру форума
думаю конечно не под все индикаторы, но под некоторые хотя бы... сделал такой вариант с возможностью вносить параметры (посмотрел как в другом индикаторе и добавил по аналогии)...
Добавил во внешние параметры:
_O_iCustomPara
И в код:
void PrepareOpenParameters() {
string tmp[];
StringSplit(_O_iCustomParam,'/',tmp);
}
Посмотрите пожалуйста, вроде работает, но может что-то необходимо подправить?...

Если это просьба ко мне, то извините, я далеко не прогер. Увлекаюсь только на любительском уровне, и многое мне не под силу. А вот здешние ребята – Мобидик, Танк, Владдрагон и другие, могут это с лёгкостью сделать.
 

Аввакум2

Гуру форума
До этого меня еще Владроном обозвали...Теперь дракон (в переводе с английского dragon) - круто!:ROFLMAO:
Ну, извините. Ник не запомнил как след, а человеку по памяти писал. Так что, не обижайтесь сильно. 😉
 

loki177

Активный участник
Добавьте, пожалуйста, к этому советнику функцию закрытия ВСЕХ открытых этим советником сделок (сетки бай и селл) по общему профиту в валюте депозита.
слишком простой алгоритм, сливает обязательно.
параметр добавил, даже два - тейк и стоп в валюте.
 

Вложения

  • VR Smart Grid Lite M1.zip
    24,4 КБ · Просмотры: 52

everton13

Интересующийся
it is possible not to have to update the chart for the excess lines to disappear

1584419568894.png
 

Вложения

  • Support_Resistance.mq4
    8,6 КБ · Просмотры: 42

stargazer2011

Местный житель
слишком простой алгоритм, сливает обязательно.
параметр добавил, даже два - тейк и стоп в валюте.
Здравствуйте!
Можно Вас попросить сделать еще один нужный настраиваемый параметр - это умножение мартингейла, а то у него по умолчанию х2 и не настраивается. Спасибо!
 

mobidik

-----
mobidik а можно приспособить этого Ангела под БО на того же WForex?
Можно, а смысл, из того, что там есть, будет использовано только обращение к индюку, все остальное не подходит, + изменение установки позиции с указанием времени экспы, это если без примочек.
Если нужен бот под БО - задание в личку, обсудим.
 

gek

Элитный участник
Можно, а смысл, из того, что там есть, будет использовано только обращение к индюку, все остальное не подходит, + изменение установки позиции с указанием времени экспы, это если без примочек.
Если нужен бот под БО - задание в личку, обсудим.
mobidik,привет.
Тоже по поводу этого советника.
По стрелке всегда открывает в середине или в конце свечи.
Можно изменить,чтобы сразу при появлении стрелки входил?
 
Последнее редактирование:

loki177

Активный участник
Здравствуйте!
Можно Вас попросить сделать еще один нужный настраиваемый параметр - это умножение мартингейла, а то у него по умолчанию х2 и не настраивается.
с множителем мартина
 

Вложения

  • VR Smart Grid Lite M1_2.zip
    24,8 КБ · Просмотры: 90

loki177

Активный участник
у VR Smart Grid даже в платной версии автор не сделал обработку ошибок.
 
Последнее редактирование модератором:
Верх