Giving Something Back My Equity, Free Margin and Profit Protection EA
Page 1 of 732 12 LastLast
Results 1 to 10 of 311

Thread: Giving Something Back My Equity, Free Margin and Profit Protection EA

  1. #1
    Many people here on forexsoutheast.asia have been very kind to me personally along with my occasional demands for coding help.

    Attached is a EA I typed, which does need a Forex account that allows hedging for it to be useful. Placing it on line here for others to use is simply to give something back to the forum and as a way to say thank you.

    It's a Trade Manager type EA, not a trading egy.

    It works as follows:

    For all 3 regions (Free Margin, Equity Profit and Equity Loss), when it starts up (or you restart MT4), it calculates the difference between sell and buy lots that are open in addition to your opening equity and free margin levels.

    At pre-set trigger points that you set in inputs, it will open a trade to balance lots.

    Eg, With Equity Loss and Lending Profit, it makes the lots equal to lock in the profit or limit the reduction. With free Margin, it opens an reverse order to leave 50% of the trade in favor of the direction you have.

    The cause points and lots info are displayed on the chart so you know where things are at.

    Free Margin -

    In inputs, you can pick the percent of completely free Margin at which stage the 50% balance trade gets opened. That's, extern int FM = 0.3 implies that if Free Margin boils down to 30 percent, it will open an opposite trade equivalent to 50% of the open lots. This leaves the majority of your open lots in favor of the direction you wanted, but prevents your account in any margin calls.

    TakeProfitFM is your pips of profit this trade could be shut at.

    Fiscal Discount -

    In inputs, you can set the maximum loss of equity you will accept before an opposite order will balance your own buy/sell lots. That is extern double MaxLoss = 0.25 equals 25% loss of equity to my account will activate a balancing trade that makes buy and sell lots equal.

    If this trade is opened, it resets the MaxLoss level at the set% lower.

    NOTE: This code tracks best price/equity. As your account enhances equity/profit, it tracks and changes the MaxLoss tigger point in line with the new/higher level.

    TakeProfitML is your pips in profit this trade could be shut at.

    Equity Profit -

    In inputs, you can set the maximum increase of equity you will accept prior to an opposite order will balance your buy/sell lots. That is extern double HeapsProfit = 0.25 equals 25% profit on equity to my account will activate a balancing trade the makes buy and sell lots equal. This will be to lock in a profit, which mentally we often see disappear before our eyes before we do it.

    If this trade is opened, it resets the HeapsProfit level at the set% higher.

    TakeProfitHP is your pips in profit those transactions could be shut at.

    The best way to use this EA would be to link it to any chart. It's not related to time frames. Any other EAs you use of course run in their own charts. That's, this really is a standalone EA I use not to the key trades I open, but to cover my butt when things go bad or good.

    Any comments welcome, however please do not think I'm interested in adding lots of functions - my programming skill is only a couple rungs up the learning curve ladder.
    https://www.forexsoutheast.asia/atta...1129084545.mq4

  2. #2
    Thanks a Lot! Was actually just searching for just this!
    Cheers!

  3. #3
    You're most welcome, we are all on the same side .

    I discover it'll execute trades even when my MT4 reports it's too busy to process manual trades.

    For what it's worth, I EXPECT my trade entry points to work out, so if my MaxLoss actually gets hit, I go for a walk for an hour or two, clear my mind and look to depart that ever commerce is at its best place.

    In any event, to those of you who just wish 2% account risk money management ideas, this works just as sweet as it will for your 25% guys like me.

  4. #4
    Are you still using this EA? Are there any instructions? Not sure I 100% understand how it functions.

    Cheers!

  5. #5
    Quote Originally Posted by ;
    Are you using this EA? Are there any instructions? Not sure I 100% know how it functions.

    Cheers!
    It is fully functional as posted. Its primary functions are to shut all transactions when a goal% equity expansion is reached, OR to balance all transactions with a single hedge trade if a minimal equity position is reached.

    No I don't use it. My personal trading design has evolved many iterations since I coded it. It is legitimate for people using the most complex trading systems in which many transactions could be open at exactly the exact same time.

    I have simplified my very own trading systems since I coded this EA.

    I personally see Stop Losses as the most singularly DUMBEST idea of Money Management (MM) theory I've ever heard of. Stop Losses have never MANAGED money. They are a LOSS Management system that is systemic.

    IF EVER I'm so wrong with a trade entry, I need that place locked up with an opposing hedge. And I shall manage unlocking this hedged place by using my following trade entry set up to shut one leg of my market (not opening a 3rd trade), and then using my trading system to later close the rest of the leg of the hedge - ideally also in profit, but at least at a break even position.

    The EA I've posted here was designed for more complex trading systems in which you can see any number of open transactions in precisely the exact same time. It did the maths to say OOPS, also hard when a minimal degree of remaining equity was attained and it makes 1 trade to hedge the books out as balanced. That is, if the trigger you set has struck, it makes 1 trade to balance all buys and sells out as equal.

    Alternatively, it states COOL, too easy, equity profit target reached, allows close all of the lemon transactions out and begin again from our new, higher equity position.

    Its history stems back to decades ago of a trading egy I designed with Fractals. This trading system I designed back then was founded on some wisdom by an old timer named Bill Willi, who had been a participant before the Internet times and MT4.

    This system I had been working with way back then was to perform with any Fractal amount that has been breached was a (impending stop) trade worth carrying. And from visual testing, it seemed that every breached Fractal sooner or later forced profits.

    Afterwards I learned that brokers have their own limits on the number of open transactions you can have in precisely the exact same time, and I soon abandoned this line of egic design.

    Oddly enough, I have lately mentioned to some Forex pupil I'm mentoring how I will be revisiting Fractals some time soon for the value they could offer in exchange set-ups.

    In any event, long after I did depart my Fractals job, I did code the EA you're speaking about to lock up a intrie lot of transactions with a single hedge trade if a low-equity trigger point was reached. And I also coded this EA to shut all transactions if a goal% equity expansion point was reached.

    Anyway, this EA reflects my deepest belief in hedging rather than stop losses.

    In complex trading systems, this EA reflects my belief in closing all transactions when you've created your target equity%.

    But my trading system these days isn't complied, and so I don't use this EA.

    Phil

  6. #6
    Thank you for the thoughtful response. The reason I was looking at this EA was easy for the hedging functionality. I also have a very simple style and was looking for some way to hedge my positions (usually only one) in those rare cases when fatigue selling/buying pushes the market further than I expect.

    Do you currently automate your hedging or do you do it manually?

  7. #7
    Quote Originally Posted by ;
    Thank you for the thoughtful response. The reason I was looking at this EA was easy for its hedging functionality. I also have a very simple style and was looking for some way to market my positions (generally only one) in these rare cases when exhaustion selling/buying pushes the market further than I anticipate.

    Can you currently automate your hedging or do you do it manually?
    You can search for MPTM, an EA from Steve Hopwood.

    His Multi Purpose Trade Manager is most likely the ugliest code you will ever find, but its bare bones hedging works do work. I vouch for none of its remainder.

    NEVER have hedge the monster set to true or you're in for a world of harm.

    ALWAYS have MetaEditor open if you believe you might want to alter a setting in his MPTM. I say this since you will never be able to open MPTM to access its settings after it's been attached to your chart. Should you have to make a shift, then you have to eliminate it, and modify the setting because you reattach it, or make the shift in MetaEditor and then re-complile it while it's attached.

    I do use it. The limits of it are known to me personally. It has its perils.

  8. #8
    Hi, I was wondering in the event that you can created to get me a special variant with a tiny modifiion: instead of closing all trades when a goal% equity growth is reached, OR to balance out... send an email as awake.

    Thank you.

  9. #9
    I lately re-stubled on this page today... I finally downloaded the EA and will be providing it at test run. I agree with you ingphil about hedging your way from positions - I was doing it manually to great success before I fell asleep with several un-hedged open transactions a couple of weeks back... when I woken from my peaceful slumber I immediately tried to hedge but did not have sufficient equity left to do this.... An EA like this would have come in handy...

  10. #10
    Hi Phil.
    First of all thanks for sharing.
    Have been looking for something like this for a short time. I'd like to trade with larger lot size and hedge rather early if things go the incorrect way.

    I really downloaded your EA and also paid a developer to upgrade it to MT4 600 construct.

    Therefore I am mainly interested in the funktion equity loss where I can balance out a trade gone bad.

    However there are a number of issues I believe have to do with the upgrade (reprograming). Tried it out on demonion but it did not trigger any trade once the equity dropped.

    Doesn't the EA handle all open trades? Trades I have opened to do I have to open manual transactions using a script in order to receive a magic number?

    Hope you still are reading this thread. Is it possible to get in touch with you. Tried to send you a message but that option was blocked.

    Could you please contact me:. Have a questions regarding your other thread to. Seems like you trade the way I'd like to.

    Feel as though I am standing on the bottom of a stair You've already climbed...

    Knr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.