Not logged in
Viewing 5 posts - 1 through 5 (of 5 total)
  • #260190 |
    Customer
    501 Posts

    i want to make an EA, which will set the SL and TP only when i open my manual trade

    i will manually open my trade (without SL and TP) and i want to set by EA immediately the SL to the lowest(5) /for BUY and highest(5) for sell/ and TP as 1:1

    is it possible by AW?

    You want to be a profitable algotrader? Sharing of final strategies with real traders just started. Fill in this FORM. 1500+ final SQ3 and SQX strategies for members running on demo accounts DEMO ACCS. We provide also strategies for indices - DAX and DOW JONES, because we have realtick data from brokers.

    #260207
    tomas262
    Administrator
    1427 Posts

    Hi,

    you should be able to do that using built-in function “Set stop loss” and “Set profit target”. The magic number parameter needs to be set to 0.

    Let me know if any issues with that

    Attachments:
    You must be logged in to view attached files.
    #260216
    Customer
    501 Posts

    i tried it, but get an error while i want to save MQL4 code

    An error occured while generating the strategy XML source code.
    Exc. When calling macro “printBlock”, required parameter “block” (parameter #1) was specified, but had null/missing value.

    —-
    Tip: If the parameter value expression on the caller side is known to be legally null/missing, you may want to specify a default value for it with the “!” operator, like paramValue!defaultValue.
    —-

    —-
    FTL stack trace (“~” means nesting-related):
    – Failed at: #macro printBlock block shift=”0″  [in template “MetaTrader4/mt4Blocks.inc” in macro “printBlock” at line 208, column 1]
    – Reached through: @printBlock signal?children[0]  [in template “MetaTrader4/mt4Blocks.inc” in macro “printRule” at line 139, column 46]
    ~ Reached through: #nested  [in template “MetaTrader4/Functions.inc” in macro “replaceBr” at line 4, column 18]
    ~ Reached through: @replaceBr  [in template “MetaTrader4/mt4Blocks.inc” in macro “printRule” at line 74, column 1]
    – Reached through: @printRule rule  [in template “MetaTrader4/mt4Blocks.inc” in macro “printRulesForEvent” at line 63, column 1]
    – Reached through: @printRulesForEvent “OnBarUpdate”  [in template “MetaTrader4\\Main.tpl” at line 143, column 1]

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

    You want to be a profitable algotrader? Sharing of final strategies with real traders just started. Fill in this FORM. 1500+ final SQ3 and SQX strategies for members running on demo accounts DEMO ACCS. We provide also strategies for indices - DAX and DOW JONES, because we have realtick data from brokers.

    #260217
    Customer
    501 Posts

    the logic should be simple – if any open trades occurs and it has no SL, set SL

    You want to be a profitable algotrader? Sharing of final strategies with real traders just started. Fill in this FORM. 1500+ final SQ3 and SQX strategies for members running on demo accounts DEMO ACCS. We provide also strategies for indices - DAX and DOW JONES, because we have realtick data from brokers.

    #260222
    tomas262
    Administrator
    1427 Posts

    No need to use the standard template. You can simply setup 2 tabs like in the example attached.

    Use ‘MagicNumber’ variable as the magic parameter. it is set to 0

    Now it returns the source properly

    Note: I see no error in your setup so I reported your version to developers to check why it had the issue with the source code

    Attachments:
    You must be logged in to view attached files.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.