Can someone help me with SL calculated form wick?
-
Hello guys,
can someone help me please, because i dont know in this case how to get it as easy as possible.
My part-target for my EA idea is to find the lowest wick of the last n candles in the past and choose them plus aktual spread as SL.
E.g. i get a signal for the EA for BUY.
- Now i want from the last candles id 1,2,3,4,5,6,7,8,9,10 ... (which i can choose later in the EA to optimize), the lowest bottom wick , plus (minus actual spread) i want that he takes as SL.
Can you maybe help me? I could make it maybe complicated, by IF Candle ID1 bottom wick < Candle bottom candle wick 2, -> else ... but this looks to me too complicated. I believe it would work but not effektiv. Also i dont know how to add the spread to it.!
Is to choose the lowest price of n candles here the best way? If yes, how do i put the spread to it to get a SL=
- and another question is, if i want to use the difference of BUY to SL as % for a % lotsize e.g. 0,5% of balance, how can i use it? I tried so many things now, but i think i have a thinking problem.

Thanks a lot for your help!
-
-
@miro1360
So the point of the blocks ID's is (beside identifying them for counter reset) : When there are 2 different paths/blocks, coming out a block, the one with lowest ID is executed at the tick X, and the second one at the tick X+1 ? -
all blocks are executed at the tick X, but the order of path execution depends on the ID (lowest first) ... did you get it?
the example above goes as:
8-9-10
11
12-13-14
16
20
21-22 or 21-23
... everything in one tick (if an execution time is less as the time between 2 ticks) -
here the execution is as:
8-100-10
1
21-22 or 21-23
11
2
12-13-14
-
Waow, thanks for the answers.
So i am happy that my question wasnt so stupid when i see the work you putted in to realise it.
Thanks a lot btw.!Havent tried it out atm, but will do it later.
What i found out, but havent tried because i am not at home to get on my MT4 is, to look for the lowest price of the last n candles.
Do you think this can work too? Or do i think wrong? I mean the lowest price also must be the bottom wick or?


As i said i havent tried it out, but if you say this does not work, and i have a logic thinking misstake, would be nice to know what i made here wrong

-
@miro1360
Oh right i see, with your 2nd exemple, it executes the blocks of the right "branch" first...
I didn't think it could execute every blocks of an EA in such a short time. -
@tom-5
you are exactly right, I totally forgot about this option in the Martket properties, you can use it this way .... anyway if you come to a stage where you need more detailed logic then you already know how@seb-0
it can execute 1000 of simple blocks in one tick as well as one very complicated custom block may need a few ticks to execute
... the above are very simple blocks (light blocks, easy to calculate)a complicated block is something where EA has to use many array calculations (e.g. complicated work with zigzag) .... or a bad or overlooped logic

-
@miro1360 thanks a lot for to let me know that this will work. And btw. i learned a lot from you in the past - thanks for your qualified answers and to share you knowhow with us!
Can you maybe share you example you made so that i can open it and look into it, because i havent worked with variables and formular s so far. Would be a help for me
thanks in adavance! -
In my first reply is the shared link. Generage mql4 from that and then import the generated mql4 file into your projects.
-
@miro1360 thank you
Still have to learn a lot. I am good in manual trading but still have to learn bit of the logic you use here. Saw first time how you use the field "adjust" and so on - but still have to look how you did it, but with it it looks like that the possiblities are endless. -
the possibilities are endless if the effort is endless

-
@miro1360 said in Can someone help me with SL calculated form wick?:
the possibilities are endless if the effort is endless

Or as i always say to my students "as more you learn as more you earn"
Nice to meet you btw. 

