Not logged in

Forums

Viewing 15 posts - 1 through 15 (of 19 total)
  • #203521 |
    Participant
    78 Posts

    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.

    #203650
    Administrator
    558 Posts

    Hello,

    so you want to combine all of these rules?

    #203653
    Participant
    78 Posts

    Hello, yes i like to combine all these

    #203689
    Administrator
    558 Posts

    Hello,

    it can be done like this

    Attachments:
    You must be logged in to view attached files.
    #203748
    Participant
    78 Posts

    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.
    #203747
    Participant
    78 Posts

    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…

    #203810
    Administrator
    558 Posts

    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.
    #203938
    Participant
    78 Posts

    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.
    #204012
    Administrator
    558 Posts

    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.
    #217737
    Participant
    78 Posts

    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 ?

     

    #217741
    Administrator
    558 Posts

    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.
    #233190
    Participant
    78 Posts

    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…

    #233194
    Participant
    78 Posts

    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

     

    #233220
    Administrator
    558 Posts

    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?

    #233233
    Participant
    78 Posts

    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

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.