That position is opened long time ago, why it's open price to change? I mean, someone else will prefer open price to remain the same... and it seems that this is the case. Try to modify relative to the current market price (the first option in Modify block) - it will choose Ask or Bid depending on the position type.
Posts made by fxDreema
-
RE: Modify SL TP blockposted in Bug Reports
-
RE: Modify SL TP blockposted in Bug Reports
I think Open price remains the same, the position is not closed after all. What if you try to modify stops relative to the current price?
-
RE: I need Idea on to code the EA base following parameterposted in Questions & Answers
And what did you tried? What is the actual step that you can't understand?
-
RE: Custom inidcatorposted in Questions & Answers
You have "on Tick" - blocks placed there are executed on every tick. Well, the ones at the top (where no blocks are connected above them). These blocks should be conditions, filters... anything that asks for certain condition before taking some actions.
Tick comes -> Check some conditions -> Do some actions.
For example, conditions might be:
No trade is running -> Check if MA5 is above MA10and the action can be:
Buy nowAlso there is a category for working with indicators. This category is named "Indicators" and it contains some blocks that are some kind of complex Condition block. Also Condition can be used to check what it has to be checked.
Indicators are different in how they communicate with the EA. They communicate with their buffers. On each of these buffers you have current value and values for each bar in the history where the indicator is drawn. A buffer is an array... if we have to say it in programming language. And "Indicators tester" is used to just see what is in a single buffer, at least to know if it's something meaningful, not crap (because there are many indicators with crap on their buffers).
-
RE: Custom inidcatorposted in Questions & Answers
Connect it with "Pass" under "on Tick" and select some indicator inside. Here is a little example with it (it was previously named "Levels tester" and I have to update this example): http://fxdreema.com/demo/levels-tester
-
RE: at least n position are running was updatedposted in Questions & Answers
Well, MT5 works with positions and you can count them if you work with many markets. Some things in MT5 are logically different.
-
RE: at least n position are running was updatedposted in Questions & Answers
Check trades count. And I think this one is much more intuitive, as I was always confused by these "at least..." and "not more than..."
-
RE: Formula block - count trades of certain Groupposted in Questions & Answers
I can see you start counting when the EA is started... or at least it looks like this. Actually you can count over the past trades and orders using "For each...." blocks. Well, now I realized that I should add option in "For each Closed Trade" to not go to very old history trades, but at least you can specify exact amount of past closed history trades to work with.
I can suggest to define and use a variable (click Variables) instead of Formula's result variable.
Here is a little example of how to calculate lot sizes of buys and sells: http://fxdreema.com/shared/bvrTBQFKb
Or even better with this one: http://fxdreema.com/shared/NwqfdGorc
this example is better because you loop trades once, and for each of them you ask for some of it's properties (in the case - it's type) before incrementing other parameter. So you can actually loop all available trades from all groups, and within the loop to check it's group number.... I think you will get it
Read the information of these pink blocks to understand how they work. You will probably realize how this second properties panel works.
I used "OrderLots()" which is a native MQL4 function that returns the lot size of the currently loaded trade, but you can also use "Formula" or "Condition (+Adjust field)" or "Modify Variables" to modify a variable. In these blocks the given parameter (for example lot size) is hidden somewhere in the pink "(in loop)...." category. -
RE: Затваряне на поръчкиposted in Questions & Answers
И да вметна, че ако някой от вас познава някой ентусиаст дето разбира малко от програмиране и му е интересно да създава нови неща, които едновременно да помагат на него и на другите около него, и също така този някой е коректен, не се прави на лош шеф и дори не харесва шефове, а освен това и все още е незаробен от живота (работа, семейство)... може да го насочи насам

-
RE: Затваряне на поръчкиposted in Questions & Answers
Добавих ви на двамата по един custom блок с полуофициална версия на този блок - има разни входни параметри за по-фино настройване. Макар че не съм 100% сигурен дали всичко работи както трябва, надявам се.
Нещо което май е добре да се направи е печелившите поръчки да се смятат (и затварят) не само по размер на профита, а и по тип. Примерно да се затварят с предимство поръчки от противоположния тип. Или пък от същия тип? Или от типа (Buy или Sell) от който са се натрупали по-големи загуби като цяло, че поръчката с най-голяма загуба може и да не е от типа който в момента върви на загуба, съответно може да се счете за не е толкова спешна.
Екзотики от типа трейлинг стоп не ми се вкарват в този блок. Имаше вметка за частично затваряне на поръчка... не знам, може би. То MetaTrader 4 не е много гъвкав с неговата лот стъпка.
Аз обаче все се опитвам да свия нещата до възможно най-елементарния сценарии, и мисля че тази стратегия може да се сведе до мартингейл. И в двата случая се опитваме да покрием натрупала се загуба - дали ще затворим всичко сега и ще отворим по-голяма поръчка за да избие загубите, или ще отложим затварянето за да борим губещата поръчка сега... може би на практика се случва едно и също. При MetaTrader 4 явно има различни начини да се направи едно и също само защото общата позиция е логически е разделена на отделни поръчки
Върти ги, сучи ги - всички поръчки се вливат в океана "Equity" или "Баланс" 
-
RE: Затваряне на поръчкиposted in Questions & Answers
Затваря най-губещата и толкова печеливши, колкото да покрият минимума печалба. Просто пусни един тест и ще видиш какво се случва.
-
RE: Затваряне на поръчкиposted in Questions & Answers
Как да не взима повече, нали целта му е да затваря най-губещата и няколкото други с по-голяма обща печалба, то няма много какво да му се променя. Но аз си играх два дена де, най-добри резултати ми дава когато нещата да по-прости, така че не мисли че ако му се промени това, после онова, и другото, това ще обърне резултата

-
RE: Modify error: Not initialized string in array (4009)posted in Questions & Answers
I have other types of errors - basically SL is too short and it's not difficult to understand why - ATR has some relative values very close to 0, I don't know why you are using it like this.
-
RE: Помощ за МА пресичанеposted in Questions & Answers
Взима най-губещата и ако събере от печелившите същия резултат плюс минимум желаната печалба - затваря всичките, започвайки от губещата.
-
RE: Помощ за МА пресичанеposted in Questions & Answers
Май го оправих като направих нов блок (там дето се правят блокове). Така и не разбрах защо се получаваше това, ама все тая. Аз иначе по тази стратегия пробвах разни варианти, ама както се досещаш - все се получава резултат от типа на мартингейл - хубаво, хубаво, ама до време.
-
RE: Modify error: Not initialized string in array (4009)posted in Questions & Answers
I can't replicate this, it's some other block probably or it happens with specific configuration. I think "once per trade/order" can produce this error, at least I remember similar problem before... Some example?
-
RE: Count "n" bars, then passposted in Questions & Answers
This changes this text on the chart that normally says "Working".
-
RE: Помощ за МА пресичанеposted in Questions & Answers
По принцип блоковете не вадят стойности навън, това го правят само някои, например "Function". Затова говоря за глобалните променливи, щото те се четат отвсякъде и могат да се модифицират в който и да е блок. Дефинираш Variable и я използваш вътре в който и да е блок (съответно в блока не трябва да се дефинира променлива със същото име).
Май има някакъв бъг в проекта, останала информация от някой Function блок дето се бърка. Пробвай да импортираш същия проект в нов, мисля че ще изчисти проблема.
-
RE: Count "n" bars, then passposted in Questions & Answers
I guess this is what you want to do (see propertied of 9 and 11):
http://fxdreema.com/shared/KsGEmGsad