set SL and TP

5 replies

hankeys

Customer, bbp_participant, community, sq-ultimate, 487 replies.

Visit profile

3 years ago #260190

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? We started using StrateQuant software in early 2014. For now we have a very big knowhow for building EAs for every possible types of markets. We share this knowhow, apps, tools and also all final strategies with real traders. If you want to join us, fill in the FORM.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

3 years ago #260207

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.

0

hankeys

Customer, bbp_participant, community, sq-ultimate, 487 replies.

Visit profile

3 years ago #260216

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? We started using StrateQuant software in early 2014. For now we have a very big knowhow for building EAs for every possible types of markets. We share this knowhow, apps, tools and also all final strategies with real traders. If you want to join us, fill in the FORM.

0

hankeys

Customer, bbp_participant, community, sq-ultimate, 487 replies.

Visit profile

3 years ago #260217

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

You want to be a profitable algotrader? We started using StrateQuant software in early 2014. For now we have a very big knowhow for building EAs for every possible types of markets. We share this knowhow, apps, tools and also all final strategies with real traders. If you want to join us, fill in the FORM.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

3 years ago #260222

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.

0

Conmariin

Subscriber, bbp_participant, community, customer, 54 replies.

Visit profile

3 years ago #261884

I know a bit late, but perhaps my free “Foxy S and R” is the halfautomatic EA you can work with?

https://www.rabenesche.de/home/expert-advisor-und-indikatoren/foxy-s-and-r

Automatisches Handeln mit Expert Advisor
https://www.rabenesche.de

0

Viewing 5 replies - 1 through 5 (of 5 total)