I need help with some extra coding for my EA. Im getting some help from one other on the forum (Toekan) I was just wondering is there a way I can add a if statement to my open trade. For example If I have a open trade i want (trigger) to open X more trades with a Only if a current trade is open and the last 3 bars had lower lows or lower highs or lower closes or lower opens and 41 tp (within the code it has conditions to multiply it by 10 for 5 digit broker). and close sell if (conditions) happen. Can this be made as a script or does it have to be added to the EA?
Initialize a bool variable inTrade = false. Set inTrade to true after your successful market order block. Then OnTick, check if (inTrade == true) { insert supplementary order logic }. Make sure to reset inTrade = false, upon closing the order.
Another way, would be OnTick, check if you have any open trades with the specific ID (Magic Number in MT4) that matches that of the EA.
I don’t know your strategy, but it seems to me you have a flaw in your logic. Given the description you wrote, you’re going to end up executing orders every tick, since once you open 1 trade, it open X more trades. So perhaps using an int will suit you better and rather than inTrade == true, it’ll be numTrades == 1.
My Skype information is on my profile.
“Sorry, this user has chosen a privacy option that prevents you from viewing this information.
BabyPips.com Forex Forum”
I got a warning and post deleted for asking to message or be contacted on IM. I dont understand a function for allowing users to place their skype info in their forum profile information but being polite and asking before randomly messaging someone can get your post deleted in a forum
Yeah I never understood that either, I’ve had a few infractions as well without knowing what I did wrong.
Anyway, I just checked my privacy settings (didn’t even know we had that), you’re good to go.