[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 558

 

I don't need return. it's a subfunction... I need while() to chug until it lets go... briefly like this:

double tmp=Ask; while(Ask<=tmp) tmp=Ask; Print("Заработало");

what to fix and where to make it work?

 
maryan.dirtyn >>:
все что мне нужно, ето пока Ask падает експерт ничего не делал, как только Ask на один тик выше пойдет, запуститься код дальше, с етого ж места.. ето так сложно? иду я спать, надеюсь телепаты проснуться и что нибудь да подскажут.


What's the point of the while() loop then? It's much simpler than that.

// перед блоком инициализации:
double OldAsk;
// в блоке инициализации:
OldAsk=1000000;
// в старте советника
if(Ask<=OldAsk){
  OldAsk=Ask;// аск падает или стоит на месте
  Return(0);// не даём возможности советнику исполнять низлежащий код
}
else{
  //Ask перестал падать и стал хотябы на пункт больше предыдущего значения - выполняем остальной код
}
 
aaaa, user-defined function. Well, put that part of the function code in the body of the EA and pass the result of boolean variable to the function, saying that's it, the variable is true, the asc started to grow... You may continue...
 
drknn >>:


Ну и зачем тут тогда цикл while(). Всё гораздо проще.

how do i put this into a subfunction?

void FALLS ASK {.....} ... where do we retune?

Okay... maybe I'll rephrase the problem...

void ПАДАЕТ АСК() {double tmp=Ask; while(Ask<=tmp) tmp=Ask; Print("Заработало"); Alert("Пора в лонг");}

how do I get it to work?

 
drknn >>:
аааа, пользовательская функция. Ну дык вынесите этот участок кода функции в тело советника и передавайте в функцию результат булевой переменной, мол, всё, переменная тру, аск начал расти... Можно продолжать...
Now that's an idea... THANK YOU for the fresh idea... I'll try it. p.s. (that's the thing: void won't retune... but bool will!)
 
maryan.dirtyn >>:

как мне ето дело всобачить в подфункцию.

void ПАДАЕТ АСК {.....} .. куда ретурнить будем?

ок.. возможно я переформулирую проблему..

как заставить работать?


And void does not returnee anywhere. It should not return anything to the main program.
 
thanks again! dear drknn for your patience and clever hint, about the flag in the adviser's body...
 

Help! Somebody please put a trailing stop on this code.

Files:
 
Deeepa >>:

Помогите! Прикрутите кто нибудь трейлинг-стоп к этому коду.

Have you tried to attach Kim's? Igor has a lot of interesting stuff and no problems with screwing it in, screwing it out, screwing it over.

I slightly reworked its three-level exit function. It now closes a position three times and then trawls the rest to the victory...

There's a full list of its functions in the trailer...

 
The trailer doesn't stick... Take two...