[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 468

 
boolker >>:

Помещаю скриптом на график два прямоугольника - красный и синий .

В месте их пересечения - получается зелёный.

Можно-ли сделать синий?

No, use for example... for a script will do.

void dd()
  {
          for(int g=0; g<=120; g++){
          string name="line_"+MathRand( )+MathRand( ) ;
          ObjectCreate( name, OBJ_TREND, 0, iTime(NULL,0,1),  High[1]+ g*Point, iTime(NULL,0,120), High[1]+ g*Point);              
          ObjectSet( name, OBJPROP_RAY, false);
          ObjectSet( name, OBJPROP_COLOR, Red);
          ObjectSet( name, OBJPROP_STYLE, DRAW_LINE);
          ObjectSet( name, OBJPROP_WIDTH, 5*1);
          ObjectSet( name, OBJPROP_BACK, true);
          }
          for(    g=0; g<=120; g++){
          string name0="line_"+MathRand( )+MathRand( ) ;
          ObjectCreate( name0, OBJ_TREND, 0, iTime(NULL,0,50), High[50]+ g*Point, iTime(NULL,0,80), High[50]+ g*Point);              
          ObjectSet( name0, OBJPROP_RAY, false);
          ObjectSet( name0, OBJPROP_COLOR, Green);
          ObjectSet( name0, OBJPROP_STYLE, DRAW_LINE);
          ObjectSet( name0, OBJPROP_WIDTH, 5*1);
//          ObjectSet(name0, OBJPROP_BACK, true); //Получает/устанавливает флаг фонового отображения объекта
         }
}
 
618034 >>:

Уважаемый Vinin!

Помогите мне со скриптом, который тралит ордера.

В Сode Base нашёл скрипт e-SOTrailing.mq4

Скачал, переложил в папку scripts, открыл на демке ордер stop-вay AUD-USD - 0.9200, задал уровень трала 15.

Вроде всё правильно сделал.

Однако ордер AUD-USD - 0.9200 стоит и не тралится.

Может что ещё надо сделать?




This is not a script, but an EA in the folder \experts compile -> on the chart voila

Description!!!

 
costy_ >>:

Нет, используйте например... для скрипта сойдет.

Thank you, I see.

 

Can anyone suggest a code for realization of such an algorithm?

trade opens on the market

if after X bars TP or SL does not trigger -> close on the market

 
chief2000 >>:

Знает ли кто-нибудь почему не рисуются вертикальные линии?

Спасибо!



Check the algorithm step by step.

    if(Time[ i]> Time_Extreme_Sell) {
      int shift_Sell = iBarShift(NULL, 0, Time_Extreme_Sell);

      if( shift_Sell<10   &&   shift_Sell!=0) {

I'm checking through the alt no sound, the drawing is correct.

It's like if

High[ i+2]>High[ i+1]   &&   High[ i+2]>=High[ i+3]

doesn't mean anything yet, can I have the whole code?

 

Tester can't see the story? What to do?

My tester can't see the downloaded history, the chart itself shows everything for many years back (everything is checked in the options). I am talking about M1. If I look for example 1000 bars back on M1 in the tester (when I start testing an Expert Advisor), it is blank. Terminal is Alpari Demo.

I know a perverted way, put the date of testing much earlier, and in the Expert Advisor perform testing from the desired date. What am I doing wrong?

 
sak120 >>:

Тестер не видит истории? Что делать?

У меня тестер не видит закачанной истории, на самом графике всё видно на много лет назад (в опциях все проставлено). Речь идет об M1. Если посмотреть, например, на 1000 баров назад на M1 в тестере (когда запускаю тестирование эксперта), то пусто. Терминал - Альпари-Демо.

Знаю извращенной способ, поставить дату тестирования намного раньше, а в самом эксперте производить тестирование с нужной даты.


I guess it's not working on the M1.

 
costy_ >>:

Проверь алгоритм

я проверяю через алерт no sound, прорисовка правильная.

Вроде если

еще ничего не значит а можно весь код?


I don't understand the phrase "doesn't mean anything yet" <-what exactly? That's pretty much all the code, just the missing variables

must be added before Init(). I see that the lines will be added (and only at the very end), if for the last candle shift_Sell will be less than 10 ,

but there will be no lines before that (the condition

if(High[ i+2]>High[ i+1]   &&   High[ i+2]>=High[ i+3]) {

is fulfilled many times).





 
chief2000 >>:


Я не понял фразу "еще ничего не значит" <- что именно? Это практически весь код, только недостающие переменные

надо добавить перед Init(). Я вижу что линии будут добавляться (и лишь в самом конце), если для последней свечки shift_Sell будет меньше 10,

но нигде до этого их не будет (а ведь условие

соблюдается множество раз).





I mean to understand the idea of the code, yes it is observed many times but then ...

Maybe.

iHighest(NULL, 0, MODE_HIGH,  20, i+3)

20 is not enough, don't look for a clue and you'll understand it all yourself, you're not a beginner))

Not a bug that's for sure.

 
costy_ >>:

Я всмысле понять идею кода, да соблюдается множество раз но далее ...

The idea is simple - each time a condition is met

if(High[ i+2]>High[ i+1]   &&   High[ i+2]>=High[ i+3]) {

time for High[i+2] is saved in the Time_Extreme_Sell variable.

Then in each such case vertical lines should be drawn at a distance of 10 candlesticks after the candlestick with time Time_Extreme_Sell.

But I see that these lines are drawn only at the very end, for Time[0] and only if there are less than 10 candles from Time[0] to Time_Extreme_Sell.

Reason: