Bar by bar trailing stop - page 2

 
qjol:

What he is gonna be with the rest of that same symbol that he dont want to use it

What qjol means is that this ea will trail every order on that symbol, eventually those you don't want to trail.

and i responed to use the comment function.



Here's an example how to trail and only trail those orders.

i hav'nt done this before, but I guess something like this


open order with comment: "This"


change line in your ea with below:

if(OrderSymbol() == Symbol() && OrderComment() == "This")


Oh, it is Case-sensitive.

 
enotrek:

What qjol means is that this ea will trail every order on that symbol, eventually those you don't want to trail.

and i responed to use the comment function.



Here's an example how to trail and only trail those orders.

i hav'nt done this before, but I guess something like this


open order with comment: "This"


change line in your ea with below:


Oh, it is Case-sensitive.


It would be nice to apply to one order then use a different trail method on other orders on the same pair.

It would also be nice to start it "X" number of pips into a trade. For instance, after 20 pips (user input) in profit start the bbb trail. Or after 3 (again user input) higher high and higher low bars start the bbb trail (Lower lows for shorts, etc). Or a combination of both.

 

what are you waiting for?

Get started

here's help on the way: https://book.mql4.com//

 
enotrek:

what are you waiting for?

Get started

here's help on the way: https://book.mql4.com//

I have dabbled in writing script.

My original post was asking if someone knew of something already available. No need to reinvent the wheel if someone already has.

 
Dr_Pipper:

My original post was asking if someone knew of something already available. No need to reinvent the wheel if someone already has.



no there's no need to do something that someone has done before, you were given an example code and you have got suggestions to change it to your needs.

There's an explendid function in the upper rightcorner called "Search", and google is great.

We'll gladly help you with programming issues, but we dont want to do your job searching what you need.


I personally come here to find solutionfor problems i can't handle by my own and to see how others handle their problems, I like to create something by my self, not just copy someone elses solution.

I love to reinvet the wheel, so it would fit my needs perfectly.


i hope i hav'nt offended you in any way, is not my intention

// Enotrek

 
enotrek:


no there's no need to do something that someone has done before, you were given an example code and you have got suggestions to change it to your needs.

There's an explendid function in the upper rightcorner called "Search", and google is great.

We'll gladly help you with programming issues, but we dont want to do your job searching what you need.


I personally come here to find solutionfor problems i can't handle by my own and to see how others handle their problems, I like to create something by my self, not just copy someone elses solution.

I love to reinvet the wheel, so it would fit my needs perfectly.


i hope i hav'nt offended you in any way, is not my intention

// Enotrek

No you didnt offend me.

BTW I also said in my op I did a search and didnt find anything.

I have pieced together code from examples here. It has been a great resource.

Thank you both for giving me a place to start.

BTW again, since you love to reinvent the wheel maybe you could...

 
=)
 
qjol:

didn't checked


Nice job on the code. Sweet, short, and simple.
 
LEHayes:

Nice job on the code. Sweet, short, and simple.

thanks & thanks to Viffer 2 i took the Fun_New_Bar() from him https://www.mql5.com/en/forum/127224
Reason: