Advanced SL EA

18 replies

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #203521

Hello, I want to create the following profitable SL-EA, but it’s not easy.
Especially the values “current course” + “current SL” and distance from course to MA.

Example:
1. SL = Low (2)

2.
Current price is> 40 pips from the opening price of my order (break even)
then: set SL to break even + current spread

3.
if Close Low (1)> current SL
then: move SL to Low (1)

4.
SMA10 + 10 pips distance => current SL
then: move SL to SMA10 + 10 pips distance

5.
if gap current rate is greater than 40 pips to the SMA10
then: move SL + 30% of the distance from the SMA10 to the current price

How can you realize that?
Thank you for ideas or examples.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #203650

Hello,

so you want to combine all of these rules?

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #203653

Hello, yes i like to combine all these

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #203689

Hello,

it can be done like this

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #203748

for the file , i have an error “custom function” maybe. Its not possible here to paste the source code with the error. here`s a picture…

Attachments:
You must be logged in to view attached files.

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #203747

Hello, it looks very good, but i become an error from (custom function). How can i fix it ?

From source code:

“Exception:
Only elements with no child elements can be processed as text.
This element with name “param” has a child element named: values
The problematic instruction:
———-
==> if-else [on line 85, column 7 in Mql_MT4/BuildingBlocks.inc]
in user-directive compress [on line 82, column 51 in Mql_MT4/BuildingBlocks.inc]
……
———-

Java backtrace for programmers:
———-
freemarker.template.TemplateModelException: Only elements with no child elements can be processed as text.
This element with name “param” has a child element named: values

….. and so on…

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #203810

Hello,

ok, resaved + pictures of the setup attached

Bear in mind you need to use brackets at the end of OrderStopLoss() (it is not visible within condition)

Attachments:
You must be logged in to view attached files.

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #203938

Hello, Unfortunately, that does not work for me yet. I get back the error messages in the source code here…

Attachments:
You must be logged in to view attached files.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #204012

Hello,

please try to apply the patch files attached onto your EA Wizard folder, restart EA Wizard and try to re-export the strategy

Attachments:
You must be logged in to view attached files.

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #217737

Hi tomas, thank you it`s working now. My installation was on drive D: , and install new on C: and use the files…

second question to 3. above

>>>>(
if Close Low (1)> current SL
then: move SL to Low (1))<<<<

i like to save the position fast, if the Low[1] higher as the Order Start-Price and Spread – then set SL to Breakeven. But in menu “Enter the Market” > “Move SL to Breakeven” can set only Pips? How can i do this ?

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #217741

Hello,

you can also set a specific price for move to B/E action. See the screenshot

Attachments:
You must be logged in to view attached files.

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #233190

hello,
if i like to trail from SL to BE with ema30 example, i try at “MoveStopLoss to BreakEven” ema30 as variable ?
The trailing will stopped at BE ? (thats what i like, because over OrderOpeningPrice i like to trail with other trailing…

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #233194

hello, the test with variable at “MoveStopLoss to BreakEven” is not so good, because the SL will be set on BE without trailing , if the EMA30 = BE.
i like to trail the EMA30 if close>open from SL only to BE. After this i like to trail EMA 50 , if the Price is 10pips higher as the SL

Currently i have no solution, how can i do this.

many greetings and thanks for an example

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #233220

So until BE yo want to trail using EMA 30 and after using EMA 50 ? I can make an example on this. 10 pips is the trail distance?

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #233233

Hello, yes until BE trail ema30, mean the trailing ema30 stop is on BE. Later,  price is 10 pips higher as SL ( on BE) then trail ema50. The 10 pips is not the trail distance, is the distance for the second ema50 trail to BE. The ema50 trailing starts 10 pips over Opening Price ( BE) and not immediately. Thank you for example

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #233238

Hello,

ok I think this can be done. I will try to make an example for this and post

0

Viewing 15 replies - 1 through 15 (of 18 total)

1 2