@trader-philipps Hi... It looks like I found the problem for the opposite orders simultaneously... The code like it like this:

Not like this:

Thank you so much for your input.. most appreciated!!
@trader-philipps Hi... It looks like I found the problem for the opposite orders simultaneously... The code like it like this:

Not like this:

Thank you so much for your input.. most appreciated!!
Morning.... What green and red candle are you talking about? Do you have indicator that turns the candle to a colour? Please share your project or indicator because I do not know how to help you if I do not understand the question
By the way....... Only post your question once..... if there is a member that can help you someone will answer. It will get confusing if everyone post their question a few times.. How would you know where to look for the answer if there is many posts with an answer to your question??
@l-andorrà .. well, its obvious he do not want to do it because he says ... he does not have the time... so... He thinks you have more time... it is not about how difficult the coding is ... it is about ..who has the most time on hands... lol!!!
@zzjie go to the How to section, then The Tutorials and also you can search for examples of how other members has done there Expert advisors.. There are literally thousands of expert advisor information
https://fxdreema.com/

@ambrogio Thank you.. Thank you brother!!! Yes this is exactly what I also want to do!!! Grateful to you
@line I will also help him, in my very limited knowledge but I want him to do something first... and also its a slep for me because I am using mq5
@roar You are the king!!! Thank you, it is working now.. Really appreciate your help!!!
@roar Thank you Roar.. it is working excellent!!! I very much appreciate your help.
@roar ...... Sorry Roar... it is a real bummer when people do not give feedback after you have put in so much energy in helping them ... So I just want to ... Thank You .. on behalf of seemab and our other noobs learning here. (I hope covid was not the reason for seemaab not answering)
@albertomtferreira I do not need this but, just wanted to compliment you on a very neatly done and efficient code.. Excellent work .. Thank you
@tipsywisdom So true.. and he has disapeared!! what a loss to Fxdreema
@tipsywisdom EURUSD Jan 2020 - present .. Does not matter really because I will not use it as is, till the algo problem is sorted and I can trust the expert. This is just to show the mechanics of the expert is working well under the circumstance.
I think I found the problem: When I converted the mql4 to mql5 the coding part stayed mql4.
This mql5 code works correctly:
https://fxdreema.com/shared/CzVwaUHGb



@mr-lenny Start here... good luck
0_1647850511114_avg.ex5
https://fxdreema.com/forum/topic/11771/mathsrand-problem/2
Also check this thread:
https://fxdreema.com/forum/topic/10350/profit-math/66
@khalids222 .. @jstap have given you advice on how to start, showing you one step of a few others you still need to do, he is not gonna built your expert that you have to do on your own!! I have done what you are asking already, and have posted the expert in the forum. Just take the time to search for it. Check out Profit math. I have posted an already finished expert with averaging.
And now for some friendly advice =
Don,t get upset and all grumpy!! .. Mr @jstap is not under obligation to help you, he does this for charity and from the goodness of his heart. So does every one here. So keep your tone down!!
What Jstap is asking: How do you decide to open trades? not what is your martingale(money) strategy
@roar .... Hallo Roar.. I need your help again Please. I figured out how to make a counter to stop endless accumulating orders in one direction trend.. Will you please check it. It is working but something goes wrong with it now and again and then put more orders as what it should.
I am having a problem of how to Trail stop the last order only placed by expert for when there is a retrace. The idea is, if the last order placed comes in profit, to trail it till stop-out and if price action should continue in the original trend direction to replace similar order where it was original(and continue with the placement of the original negative tree) Check picture
Thank you in advance
