Greetings @roar @line @l-andorrà ,
Can you please tell me where would I place this in my shared folder. Also can you please tell me what are the P3,P4,P31,P32,P33,P39, P40.
Doing this is really giving me a headache at this point XD
Greetings @roar @line @l-andorrà ,
Can you please tell me where would I place this in my shared folder. Also can you please tell me what are the P3,P4,P31,P32,P33,P39, P40.
Doing this is really giving me a headache at this point XD
Greetings @l-andorrà ,
It is ok. I will re-explain myself. The condition is simple, when price is overbought or oversold, open one position. That position would have a lot size of 1.0. When the position with lot size of 1.0 closes, and within the same candle bar conditions are still met, then open another position with lot size of 0.9 (-0.1 lot size from the previous position closed). This somewhat worked when we had the "No position/order". The issue is that, when condition are met, it is not opening position. There are no limits to how many position ought to be opened. The issue, to be more specific, is that when the EA discovers that price has been overbought or over sold, it opens positions and closes them as well. But, as time passes by, essentially conditions are going to be met again (when it is either overbought or oversold), during that stage it is not opening a position; when conditions are met again on a new candle bar.
For a better understanding, lets look at the picture below:

As you can see, the first position was opened at lot size of 1.0 which is great. But after a while, conditions are met, but it opened position size of 0.9, which is wrong, because this is a new candle, therefore, the position must be opened at 1.0.
Always when a new candle is opened, and conditions are met, open with lot size of 1.0. Then if conditions are met within the SAME candle, decrease the lot size by 0.1.
*EVERYTIME conditions are met (whether overbought or oversold) a position must be opened, the trick part is where is it opened, if it is opened on a new candle, then the position must be lot size of 1.0. The key is that where and when are the position being opened, if it is opened within the same candle then decrease the lot size, if a new candle is opened, the restart; starting lot size would be 1.0 and if conditions are met within the SAME candle, then decrease the lot size by 0.1.
I appreciate you help, and my apologies if I was not clear before. If there are any questions, please do tell me.
--To answer you questions, no there are no limits.
Shared Folder:
https://fxdreema.com/shared/AxtJUMA6d
Sincerely
Greetings @l-andorrà,
That did not quite work as per below image:

Issues:
It only took one position per bar; after position was closed, conditions were still met, yet no positions were opened, which is odd.
It is not closing the positions at the new candle opening price; as you can see, there is a red dotted line, which indicates that it took a couple of bars to close the positions.
**I think we should target the first issue, which when conditions are met, the first position must start off with lot size of 1.0 and then decrease it by 0.1. When the position with lot size of 0.1 is closed, any further positions ought to be opened shall be opened with lot size of 0.01 until a new candle is opened. When a new candle is opened, then close previous position and check if conditions are met. If conditions are met, then open a position with lot size of 1.0, and the process repeats itself.
If there are any questions, or if there is something unclear, please do ask me.
Shared Folder:
https://fxdreema.com/shared/YZDOmflV
Thank you for your cooperation and your earliest response is much appreciated.
Sincerely
Greetings @l-andorrà ,
After amendment, it still did not work. Below you may find the image:

Shared Folder:
https://fxdreema.com/shared/bWGQGFJSc
*As you may see, it was successful in decreasing trades, but it is not opening the trade every time conditions are met (in this case, when RSI indicates overbought or oversold). Your further assistance is much appreciated.
**If I am not mistaken (bare in mind I am not an expert), the EA is decreasing lot sizes by 0.1. But I do not think that the EA understand that when conditions are met again, it should restart the process; as in open the position with lot size of 1.0 and decrease it by 0.1. I think if I am not mistaken, the EA is decreasing lot size by 0.1 on a general basis, therefore, after 0.1, well then comes nothing because 0.1-0.1 = 0. I am not sure, it was just a thought. The EA should open position for every time conditions are met
Sincerely
Greetings @l-andorrà ,
Thanks you for your cooperation. There is just one small problem. Below, you will find an image, explaining that the EA is not opening position for every time conditions are met, which is a bit odd.

As you can see from the image above, it has successfully decreased trades up to 0.1 (I expected to see the next position after 0.1 to be 0.01, but we can not decide on event, so we can do this last, however, it was successful enough to decrease trade), but it did not reopen trades later on when it was overbought or oversold (when conditions has been met). What do you recommend we should do?
*The issue for now is that it is not opening a position for every time it is overbought or oversold
Shared Folder:
https://fxdreema.com/shared/4dIzODw2d
Above is my shared folder, I kindly request from you to have a look at it, I made it a complete replica of your latest shared folder. Kindly check if I did something wrong (hopefully I didn't)
Your response is much appreciated
Greetings,
Do you care to tell me, where do I fit your shared link in my shared link? (like where how do I connect what you created with my shared project
Also what is the type for variable and constant?
Greetings @l-andorrà,
Don't worry about money management (I am testing a certain philosophy.
There is no limits regarding what is the maximum number of open trades possible. only the fact that only one position is opened for ever time conditions are met.
For every candle opened, when conditions are met, one trade is opened. The first position is opened at lot size of 1.0, and then for every position closed decrease the lot size by 0.1. Then when the position with lot size of 0.1 is closed, any other ought to be open will be opened at lot size of 0.01.
When a new candle is opened, any opened position shall be closed.
*It is important that when a candle is opened, and conditions are met, and there is a position already opened, the first step is to close the previous position, then open a new position with lot size of 1.0 (-similar to step 3).
*I appreciate your concern, but do not worry about anything else. I just kindly ask for your help.
Sincerely
Greetings @l-andorrà
It isnt issue.
Greetings,
I want to create an EA where when conditions are met, a trade will open. However, only one trade must be opened when conditions are met. The take profit is simply one pip. There is always a possibility that a position will not take profit, therefore I would like any opened positions to be closed on new candle opening price.
This is where things get a bit complicated:
When conditions are met, the first 10 trades opened will start with lot sizes of 1.0 then 0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1, then when the last trade with lot size of 0.1 is closed, then all the other next positions that ought to be opened when conditions are met, will be opened at lot size of 0.01.
Shared Project:
https://fxdreema.com/shared/Qh9BQxlje
Notes to simplify things:
When conditions are met, open a position. If it took profit, and conditions are still met, then open another position. (only single position will be taken)
The first position opened when conditions are met, will be opened at lot size of 1.0. When that position is closed, the next position to be opened (within the same candle) is 0.9, and so on. Essentially after the position with lot size of 1.0 is closed, lot size will gradually decrease by 0.1 for every position closed. Until it reaches 0.1. when position with 0.1 has been closed, then the next position to be opened will be 0.01.
Any positions opened will be closed immediately on the new candle opening price.
At the same time, when a new candle is opened, and the previous position is closed, and conditions are met, then open the position with lot size of 1.0, and ten the process repeats itself. For every candle opened, the first position to be opened will be opened with lot size of 1.0
*Kindly note:
Your earliest response is much appreciated.
Sincerely
Greetings @roar ,
A thousand apologies for disturbing you. I just wanted to thank you for your earliest response and support.
Just to give you a brief on my project. I am simply trying to create an EA on mt5, where positions are open based on the RSI indicator (Overbought/Oversold). Essentially there are no stop-loss, there is a take-profit (which is very minimal). Opened positions are closed after a candle or two has passed by.
I am positive that the first couple trades are going to take minimal profit, at the same time I am positive the last trade opened, is going to be a loss. Which is why I would like the EA to open the first couple positions with lot size of 1.0 (must be adjustable) and as more positions have been closed, the lot size will decrease. For example, if the first position started at lot 1.0, then every 2 positions (for example, must be adjustable) lot size will decrease by 0.1. However, when EA closes the two positions, both with lot size of 0.1, then the next positions taken will be 0.01 (because you can not take positions a 0 lot position (0.1-0.1=0) until a new candle/bar is opened.
When the new candle is opened, and no position are opened, then restart. What do I mean by restart. I mean the positions that will be opened on a new candle when conditions are met, shall start over starting with lot size of 1.0, then every two positions closed, decrease lot size by 0.1, until lot size reaches 0.01. And the process goes on and on.
I just wanted to explain it to you in detail.
I would like to tell you that I am not a programmer, and I am really new to the whole mt5 forex trading world. As much as I read the articles presented by fxdreema, I still have blank mind unfortunately. So I kindly request from you, at your earliest convenience to baby step me, as in tell me exactly what should I do in fxdreema (what to type in, which blocks to connect) in order to complete this project.
My struggle is how to start the lot size by 1.0 (adjustable) when conditions are met, and then every 2 positions closed (adjustable), decrease the lot size by 0.1 (adjustable) until the EA reaches lot size 0.01. Then on new candle restart lot size, start with lot size of one and decrease as positions are taken.
I kindly request help from the one and only @roar with my struggle.
Shared Project: https://fxdreema.com/shared/ntRhJgAUc
Sincerely
Rami
Greetings @roar ,
Apparently, you're the man. And I need you help now more than ever
Greetings @l-andorrà ,
Shared project; https://fxdreema.com/shared/zhCoCnFad
It is still doing the same thing. Do you think can help me out?
Greetings @line @roar @AlphaOmega
Do you think you can help me creating the variables please?
Greetings @line @AlphaOmega ,
Thank you for your help.
Shared project: https://fxdreema.com/shared/4moikGxke
Is this what you have asked for.
@line @AlphaOmega Greetings,
This all what I have.
Shared project: https://fxdreema.com/shared/JbL3P8xDd
Greetings,
Shared project: https://fxdreema.com/shared/Bp9uQg1he
As you can see, there are conditions to when positions are opened. However, I would like create an EA where if 21 and 9 re-crossed each other, regardless if they are above the 200 moving average or below, I want to close the position. How do we do that.
Greetings @l-andorrà,
What do you mean all the others.
I insist on adding this feature. So, I expect your next reply to teach me how to add this feature in details, because I do not know how to create and use variables
Greetings @l-andorrà ,
No I am not good. If you can tell me spot on where to click and what to type in, that would be great
Greetings @l-andorrà
Kindly have a look at the following picture,

Shared folder: https://fxdreema.com/shared/7NaG3OP4b
If you notice, the first position opened closed at almost the exact time. Why is that so?