@kestra
distance = (last candle: high-close)*1.3
in case of buy you have partial tp = open price + distance
in case of sell you have partial tp = open price - distance
Posts made by bk7
-
RE: PARTIAL CLOSEposted in Questions & Answers
-
RE: PARTIAL CLOSEposted in Questions & Answers
if you just use 1 ea on 1 account you can also go with a loop of the the last trade (group all).
on tick basis this loop simply has to check the profit of the last trade (loop direction newest to oldest).
this can also be done on trade basis with the check of the current closed trade (profit) and storing to a variable. -
RE: Solved___How to find the Highest Value of variablesposted in Questions & Answers
if you have 10 variables it easier to write a long if && in custom code.
-
RE: generic questionposted in Questions & Answers
@luanainteglia this mainly depends on the style of your ea and which trade logic it applies.
-
RE: WHO SOLVES THIS PROBLEM FOR ME?posted in Questions & Answers
@luanainteglia you have to check if the current time is without the non trading time of the current symbol that fixes this issue.
-
RE: Grid systemposted in Questions & Answers
@jstap as far is i understand @bagheria wants to make more than 2 trades which always depend on the actual distance between certain trades (1st grid)
so i would recommend him to get the distance as value and add or substract from the highest or lowest price depending on buy or sell positions.
This enables him to either bring as many pending orders as he wants, but brings many orders. Therefore better checks if the current price is equal or better to open of the last trade plus or minus the grid size level and open a new trade, so you dont have to deal with pending orders at all.
-
RE: 100 errors, 16 warningsposted in Questions & Answers
really ? i never had that many errors, i think max was 4 or so and that came from copying blocks around without writing the variable names correct. But if you say you had 100 within 1 block id like to see ^^
-
RE: 100 errors, 16 warningsposted in Questions & Answers
@kelte81 with 10 objects you cant make much wrong i think. The issue is on your side. If you have a setup that works it will never give you an error, that is caused by fxd. Warnings are mostly type conversion issues which are not so important...
-
RE: How to get 99% back testingposted in Questions & Answers
@tipsywisdom
darwinex really ? since when do they customers/clients allow to cash out on profits? did they change the policy, if yes please let me know
-
RE: Help with MQL block and variables pleaseposted in Questions & Answers
@alphaomega
hahaha... if you need you can contact me too. i currently work on something that has some parts you have here, but solved different way. so maybe i can help as well. -
RE: Help with MQL block and variables pleaseposted in Questions & Answers
@alphaomega
okay, so miro sure will be able to help you, good luck! -
RE: Help with MQL block and variables pleaseposted in Questions & Answers
@alphaomega
so you still have a problem or solved it, sry i am a bit confused, if yes the same or different one? -
RE: Help with MQL block and variables pleaseposted in Questions & Answers
@alphaomega
whats missing for me after a quick check is a logic that starts and ends where you have many loose blocks and loop many times first i would think what could i take from one, better use more variables and make calculation after the loop then looping that often and custom code double is just inside the block, so if you want to use the value of a variable you better make it as variable on variables tab not just within a single custom block.
Another thing i could recommend you, is null your variables before the loop, so sure they have no value, just after the loop... -
RE: How can I find the average opening price for the last two positions?posted in Questions & Answers
yes 4 deals are different from max 2 deals, why does it matter?
if you have only 2 (buy) deals max you can simply close all open orders, if you have more open at the same close all would not work, so is different.
-
RE: How can I find the average opening price for the last two positions?posted in Questions & Answers
so you want to make a grid?
what you wrote before is in conflict with your post where you said there are max 2 buy positions at any time
as you said in your last post there are 4 or more buy positions plus probably other positions...if you have a complete trading plan you can send it to me via pn and i can think about a solution, if you want you can post all here as well if you dont mind.
But without knowing all trading actions at any step needed it is hard to make a solution that works because from what i see in your last post all needs different approach. -
RE: How can I find the average opening price for the last two positions?posted in Questions & Answers
how you open the second trade?
this way buy is just once there is no trade
and what does the closing logic do or should do? -
RE: What am I missing with ENUM variables for MT5?posted in Questions & Answers
@l-andorrĂ
it will be transformed into the mode, you just need to put in the correct number thats why i put the comment that you can see the changes done by changing the number. -
RE: How can I find the average opening price for the last two positions?posted in Questions & Answers
okay so you will never ever have more thant 2open buy positions at the same time, correct?
is this with an application of min profit
-
RE: Counting of winning and losing positions.posted in Questions & Answers
this is a way different task if you want to split it in day week etc
you would need to make ranges of time for each category
so lets say day is from unixtime to unixtime
and then make counters for each category buy and sell
loop all trades
first action in the loop will be check age find category and then make the counter +1
so if would look like this: if unixtime of current trade >= unixtime_category min && unixtime of current trade <= unixtime_category max && close > open && profit >0 / then category_profit buy +1so would be 4 ifs per category (6 in your picture) so overal 24, which is no big task
bu you cant loop often for the history this takes much time, so you would need to find something that works as limit for oyu or you accept that it takes long, depending on how exact this has to be and how important.
but this should give you a rough guidance
-
RE: Counting of winning and losing positions.posted in Questions & Answers
if you want a solution that is bullet proof you need to loop all trades 1 once a certain time is over but this can take long the more trades you take
would look like this
reset variables before the loop
loop all trades for profit
make a counter per run that increases
if close >open and profit is >0 /buy profit +1
if close >open and profit is <0 /buy loss+1if close <open and profit is >0 /sell profit +1
if close >open and profit is <0 /sell loss+1is a quick draft i hope i am right with the directions of the closing trades but should give you an idea what you need...