The strategy from scratch questions and problems
-
I don't know about the condition, but you **must **use "Bucket of Trades" in this case, 2 of them actually. Look __here__for a basic example. These colors (red and green) are in no way linked to the types of trades (sells and buys). Instead, these colors are just alternative way to identify different groups of buckets. And by "bucket" I mean few trades that must be picked and selected (which is what Bucket of Trades do) and then in Condition different kind of data can be extracted out for them.
-
I show an example.
https://fxdreema.com/shared/gpQyF3Mre
In this example I want to close all positions when profit of Buy (Bucket Green) will be greater than profit of Sell (Bucket red) more than 30 percent.
Positions Buy (Bucket green) profit +131 , position Sell (Bucket Sell) profit -100. -
There are few problems:
-
X30/100 outputs 30% of X. If X = 100, then 10030/100 is 30, but it's not 130. You can use *1.3 or *(100+30)/100
-
101.3 is 13, but -101.3 is -13. In other words, this *1.3 thing doesn't work with negative numbers the way you want.
-
Let's say you have few Sells with total losses of -200. Only one Buy with very small profit is needed to say "My all Buys have profit greater thant Sells with more than 30 percent", because in reality even 0.00001 is so much larger than -200.
-
Easy to fix.
-
You can turn -10 to -7 with a little bit more complex formula using MathAbs(), but 3)...
-
I don't know how to deal with this
Here is something I was playing with. You can see the effect of 3) here - https://fxdreema.com/shared/Ky8OEJf2e (run this on Visual Mode)
Don't look at the block names, I was lazy to name them properly...
This is what I got:
http://prntscr.com/awiy59
http://i.imgur.com/UiVaHbl.png -
-
https://fxdreema.com/shared/DacOhY3ye
I want to open BUY trade once per bar. But if candle is reverse I want open new trade Sell as sum of opened BUY trades. I marked it as Green and Red Buckets.
But for example I have opened 2 trades BUY 0,01,0,01 but reversed Sell trade is 3,43 (for example) Lots. It should open 0,02 Lots Sell.
Why ? Is it bug on it? -
Am I wrong, or the Bucket blocks are not connected at all? For a block to even get into the final file (.mq4 ot .ex4), it needs to be connected to at least one other block. Let's say that now blocks 5 and 6 does not exists
-
Hi
I made a simple strategy.https://fxdreema.com/shared/Yz0FspoVc
I want to open new trade after 20 pips above / below opened trade. But EA opens trade for example after 12 pips.
What is wrong ? No trade nearby must be in other place in a chain ?Or for 20 pips is it range like this : 10 pips above and 10 pips below ?
For every 20 pips trade should I put 40 pips range ? -
Experiance is the solution

For trade 20 pips above and belowe a actuall trade - I must put 40 pips around the price.
-
Because the region of 20 pips is the total region that is up and below the current price. 20 pips in total, which is 10 pips below and 10 pips above. There are different options for "Range position". Try to double the pips or change the position of the region.
Because I have this example here, this is another way to do something similar - https://fxdreema.com/shared/2MKC15hdc
-
Hi !
I created this strategy with 2 variables and 1 constatns.
https://fxdreema.com/shared/pRABkg7hb
First variable contains a actual balance. Second variable contains Actual Balance plus Gain - this variable is from formula block (Balance plus gain) .
Gain is a constant.
I want close all trades (manualy opened) when profit is more than variable Balance_plus_gain.Why doesnt it work ? It does not close trades .
-
The profit is equity-balance, as the block says. Which means, if you have 10000 balance and gain set to 1, your trade should be on profit 10001 (equity 20001) to be closed.
Your tree is overcomplicated anyways. You need just the condition (profit > gain) and close. Same logic, much less fuss
-
oh my old brain.....:)
I thought about Equity but I put a Profit .
Thx.
-
I want to know profit from 3 (for modify) trades.
I have strategy but it shows only first trade.How to do this ?
-
Try this: http://prntscr.com/bz91rt
But I will suggest to try the Bucket blocks instead. I made them to do the things you are asking here now. -
100 usd gain can be checked. In Condition you can check the global account profit. Or use "Check profit (ulrealized)" to calculate the profit made from a group of trades (then put "Close trades" to close the same group).
Closing 50 usd is not easily possible, I never made block like this. For example "Close trades" closes trades that can be filtered by group, type, symbol or age, but their profit/loss is not checked. It can be done somehow with "For each Trade" and other pink blocks, I guess, but some Variable will be needed as well.
-
Hi
I have another problem. I created this strategy:
https://fxdreema.com/shared/qh68n5nKcI want to count a sum of lots opened on chart. But I want to count by the colour of arrows.
But EA counts it false. It add some more lots , but I don't know why ?Radoslav could you look into strategy.
Best Regards
Radek -
But why in block 190 you selected (in loop)? This is to be used when "For each Trade" is used, when you loop trades, not objects. And why do you count objects, this is strange for me
-
Hi !
Is it possible to close trades by comment ?
I have comment "xxx" and "yyy" and I want close trades with comment "xxx".
Is it possible ? -
Try this: http://prntscr.com/ft5mmm
-
Hi !
I have a diference between size of Lot B and lot B. For example diference is 0.01 .
But when I show this variable into commment (on chart) it shows 0.0100000000000001 .
Is it bug into MQL4 ? Or what ?
I want to show and take for condition two digits after comma .
Can I show only two digits after comma ?Next problem.
I want delay EA for x ticks. But block is only for x seconds. Can you add ticks possibility. I dont want to use block every tick. -
I think with these digits was not found solution because sometimes it worked and sometimes not, probably MQL4, because we tried more things ... and about x ticks you can create own counter, or maybe admin add something
