[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 190

 
I can't speak for the whole forum, but personally I get the obsession when I see a source with no indentation that it's useless to explain anything to the author.
 
MikeM:
I can't speak for the whole forum, but personally, when I see a source with no indentation, I get the obsession that it's useless to explain anything to the author.

I have the indentation in the editor, but when I copy it here, the indentation is gone...
 
first_may:

Good afternoon. Found a trailing function on the website:

...

In the trailer - working trailing functions from Yuriy Dzyuban. I traded on real account using them - no questions.

Just plug it into your Expert Advisor and go!

The third one fits exactly to your variant.


Files:
 
first_may:

I have the indentation in the editor, but when I copy it here, the indentation is gone...
Use the SRC button
 
first_may:

I have the indentation in the editor, but when I copy it here, the indentation is gone...


Here's the trawl-soviets.

Files:
 
Roman.:

In the trailer - working trawl fi ries from Yuri Dziuban. I traded on the real account using them - no questions asked.

You can connect the one you like to your EA and go!

The third method fits to your example very well.



Thank you all, I'll give it a try. And in the function

void TrailingStairs(int ticket,int trldistance,int trlstep)

can I use OrderTicket() for the first parameter?

 
first_may:


Thank you all, I will try it. And in the function

void TrailingStairs(int ticket,int trldistance,int trlstep)

Can I use OrderTicket() for the first parameter?


Yes. Use it directly (pass it into a function).
 
Roman.:

Yes. Directly - so use it (pass it to a function).


I have written it for all orders

for(i=0; i<OrdersTotal(); i++) TrailingStairs(OrderTicket(),MarketInfo(Symbol(),MODE_STOPLEVEL),1);

Got it:

18:19:26 2012.06.01 08:32 main_Ichimoku_debug GAZP,M15: modify #1 buy 10.00 GAZP at 148.25 sl: 0.34 tp: 0.00 ok
18:19:26 2012.06.01 08:33 main_Ichimoku_debug GAZP,M15: modify #1 buy 10.00 GAZP at 148.25 sl: 148.26 tp: 0.00 ok
18:19:26 2012.06.01 08:34 main_Ichimoku_debug GAZP,M15: OrderModify error 130
18:19:26 2012.06.01 08:34 main_Ichimoku_debug GAZP,M15: Failed to modify stoploss order 1. Error: 130
18:19:27 2012.06.01 08:40 main_Ichimoku_debug GAZP,M15: OrderModify error 130
18:19:27 2012.06.01 08:40 main_Ichimoku_debug GAZP,M15: Failed to modify stoploss order 1. Error: 130

 
first_may:


I have written it for all orders

for(i=0; i<OrdersTotal(); i++) TrailingStairs(OrderTicket(),MarketInfo(Symbol(),MODE_STOPLEVEL),1);

got it:

18:19:26 2012.06.01 08:32 main_Ichimoku_debug GAZP,M15: modify #1 buy 10.00 GAZP at 148.25 sl: 0.34 tp: 0.00 ok
18:19:26 2012.06.01 08:33 main_Ichimoku_debug GAZP,M15: modify #1 buy 10.00 GAZP at 148.25 sl: 148.26 tp: 0.00 ok
18:19:26 2012.06.01 08:34 main_Ichimoku_debug GAZP,M15: OrderModify error 130
18:19:26 2012.06.01 08:34 main_Ichimoku_debug GAZP,M15: Failed to modify stoploss order 1. Error: 130
18:19:27 2012.06.01 08:40 main_Ichimoku_debug GAZP,M15: OrderModify error 130
18:19:27 2012.06.01 08:40 main_Ichimoku_debug GAZP,M15: Failed to modify stoploss order 1. Error: 130


It's a mistake - the wrong stops...

There's a check in the function:

если trldistance<trlstep // это значит не возможно тралить

what value does the info return:

MarketInfo(Symbol(),MODE_STOPLEVEL)

It's possible that it's zero.

So try it:

TrailingStairs(OrderTicket(),20,5); // для четырёхзнака

In general, do not set boundaries (as you have now), but a little wider than boundaries and everything will work.

 

Can you tell me how to insert the MA into the EA? I know how to use values, but the curve itself is not rendered

iMA(NULL,PERIOD_H1,30,0,MODE_SMA,PRICE_CLOSE,0)