Help adding MaxTradesPerBar to EA - page 3

 
now attach your source code, your last post leads me to think there is one change left.
 
serpentsnoir:
now attach your source code, your last post leads me to think there is one change left.

This is what I have so far...
Files:
 

okay, small thing.

     if(TradesInThisSymbol > 0) 
     {
      return(0);
     }
 

still needs to be there, just above the line you modified.

Then you can start testing.

sn

 
serpentsnoir:

okay, small thing.

still needs to be there, just above the line you modified.

Then you can start testing.

sn


OK, added in the line above then tested. Trade tester is set at 5minute, tested with every tick, still got some bars with as much as 100+ orders/trades in a single bar. When I test with open prices only, works just great with only 1max per bar...hmm
 
megamixx:

OK, added in the line above then tested. Trade tester is set at 5minute, tested with every tick, still got some bars with as much as 100+ orders/trades in a single bar. When I test with open prices only, works just great with only 1max per bar...hmm

 
hmmm... are they trades OR buy/sell stops that expire or get replaced?
 
serpentsnoir:
hmmm... are they trades OR buy/sell stops that expire or get replaced?

Both. I checked results and saw over 100 stops mixed with trades all in one 5 minute bar.
 
megamixx:

Both. I checked results and saw over 100 stops mixed with trades all in one 5 minute bar.

I saw this https://www.mql5.com/en/forum/117867 seemed kind of similar...it seemed to get figured out on page 2...
 
i just tried a few time frames and can't recreate your results. Here is my version of the code. Compare it to yours and see if there is a difference.
 
serpentsnoir:
i just tried a few time frames and can't recreate your results. Here is my version of the code. Compare it to yours and see if there is a difference.

Yes SN, I checked and I have the same version as yours. Existing Expert properties settings work fine, the problem happens when I tighten up the stoploss I get the multiple trades per bar. It really gets bad when I change the stoploss, take profit and breakout level. Hope that helps!?
Reason: