Possible basic errors in my program structure causing issues
-
I have been using fxdreema for 4 or 5 weeks. I am very impressed It allows me to put my ideas into an algo very easily.
I have started with a simple concept & have continually improved & added features to the basic structure
I see my algo trading as a semi-auto. Allow the algo to run but be able to have manual control over certain functions
Yesterday I was trying to add max loss protection. If the max loss goes over a certain # of pips or a max # of consecutive losing trades turn off the trade opening part, but allow auto-close of existing positions to happen.
I start from an algo revision that has been tested & works. I add the max loss logic & start a test on a demo account. The max loss works OK but is not perfect & needs some refinement. I turn the EA Off via my chart control button BUT it continues to take trades. Before I did the max loss changes the ON/OFF control worked, now it does not. I check all the logic & the on/off should work. I did not touch this part of the program
So as I add to the program & make it more complex I must be doing something wrong & causing some fxdreema issues?
Here is a link to my project https://fxdreema.com/shared/H0eSkjhXd
I must be doing something wrong! any help would be greatly appreciated
Thanks & sorry for the long post -
Man, that's a huge project. Reviewing it all is VERY time consuming. Could you please try to specify the area that you guess can be wrong?
-
I am not really looking for a detailed review. What I want are more general program building guidelines. I must be doing something basic wrong. You might look at my program & see some obvious programming "do not do like this " things. Why when I start to build a more complex program do parts that worked (before that I did not change), now they do not work?
Things like I use a Pass block & turn it on/off to control parts of the program. Is that OK
Is the way I use buttons OK

Both of these do the same thing. Is one better than the other?
https://fxdreema.com/shared/9AwV3Bjqc
I realize that my question is vague & difficult to answer
Thanks for taking the time to look at my post -
@dore If you want to pass the structures twice per tick, than both are fine. If that is a mistake, none of the given ones are good.
I'd in this case do something like this

Keep in mind that block 1799 and followwed are executed before block 1801 and so on!
-
I see you use many Pass blocks. Are you really sure you need all of them? They are adding more code to the EA that maybe can be saved. I also guess that parto of your problem is nor turning on/off some of them correctly. Are you maybe using them as switches?
-
Yes I am using pass blocks as switches controlled by chart pushbuttons. I am going to try & eliminate as many as possible
-
@trader-philipps I want all the logic to run as often as possible But I only want the Buy now to open 1 trade. That is why I put the once per block at the end. Is that OK?
-
@dore Well, you should try to let run each block as often than needed. That's why I place Once per bar on the top.
-
I can't fully see the logic of all those 'turn on/off' actions. My bet is that the issue should be there. Have you checked all of them, one by one?