Maximum overkill Close-All script
Page 1 of 846 123 ... LastLast
Results 1 to 10 of 52

Thread: Maximum overkill Close-All script

  1. #1
    The goal of this script is to minimize risk in all scenarios, especially when the shit hits the fan. This script provides the very best and the fastest possible risk mitigation available thru MT4 by using some unique logic not found in any other close-all scripts.

    Operation Summary:Net positions are calculated per emblem (sum of all open transactions ). Symbols are prioritized to manage net-positions from larger (more risk) to smaller. Hedge orders are sent in the order of priority to close all exposure at once irrespective. Once all open-expo is hedged the program prioritizes pending orders Pending orders have been deleted in order of highest risk of being executed densely hedged positions (closed by hedge) are subsequently determined on the broker host and there are no costs/spread/commissions billed on the hedge (it is literally treated like a closed position) Note: This only works on non-FIFO hedging brokers. I also have included a different script that shuts orders on FIFO brokers (slowww compared to hedging brokers).
    You Might Also like the Hedge Trade Panel
    https://www.forexforum.co.za/attachm...1718684493.mq4
    https://www.forexforum.co.za/attachm...1326129861.mq4

  2. #2
    Quote Originally Posted by ;
    quote I am at the U.S. and now, I do not use any offshore brokers. U.S. brokers do not allow hedge orders so this subject is less comfortable to me, and that I can not make the most of it. However if I used a hedging broker, I'd definitely use this technique to hedge (to close) my position, then match up the orders to clear it up. Since Nicholishen states, slippage can only happen in the order process. Regarding true slippage by brokers, it seems to me you can open the hedge using Limit orders, which can be less prone to slippage than if I simply...
    You got this so right bro. This is what I think happened. The idiotic pippete fluctuation on spread over 100s of trades can make a considerable difference. Line: broker gets us one way or another. The manula multiple near functions fine because it is shutting all hedged trades in a single tick across both buys and sell position. Makes sense to simply hedge then do a manual multiple near by. Anyways, this is only a mini-project undertaking to remain sharp with trading little and aggressively using an offehore broker. I doubt it will work in a live environment. Small blow upd might be ok if performed correctly:--RRB-
    I think this excursion hniwue also helps with practising razor sharp entrances do need a bit of more work in this space as a egy to compliment my main core egy of'entrances are not significant':--RRB-

    And honestly, this is especially powerful on pairs with the cheapest needed margin. Think about it....more buying electricity, more sprucing up and more burst with included downward risk:-)

  3. #3
    Quote Originally Posted by ;
    The goal of the script is to minimize risk in all situations, particularly when the shit hits the fan. This script provides the best and the quickest possible risk mitigation available thru MT4 by using some exceptional logic not found in any other close-all scripts. Operation Summary: Web positions are calculated per symbol (sum of open transactions ). Symbols are prioritized to handle net-positions from bigger (more risk) to smaller. Hedge orders are sent in the order of priority to shut exposure in once regardless of the amount of trades. Once...
    Thinking about implementing this in my EA but won't help much for unidirectional trades.
    I have been a tad busy this week to disturb my old and loyal manual egy which I used to perform with FXCM in their TS2 for USA.... And seeking to replie the depart logic in mt4. I could manually trade over 200 trades during events with significant moves

    Here's my ask to see if there's a much better performance-tuned solution for my own exits within the context of doing a Close-All @ %equity reached

    Open Trade Volume: could be over 2000 trades to shut when a few% of equity has reached
    All uni-directional trades to shut just one instrument
    Looping all available trades is very slow and drains in my floating profit/loss whereas the loop executes. Not GOOD!

    Possible Option:Open one hedge trade of the amount of overall Lot size. This will freeze my floating profit or loss. Now loop thru all open positions and perform an alternating Partial Close of a single MINLOT in profit and a single MINLOT in reduction at a time with a few pause to avoid overloading the broker's server Is there a better solution to perform a huge close-all?

  4. #4
    Quote Originally Posted by ;
    That is amazing work by Sir Nico. Pity traders here do not recognize it. Here's a little participation by me. Close All Pairs button is Sir Nico's super mighty near by hedging script, as a button within this EA. Perhaps not a coder myself, therefore I can not clean my close up by EA in the functions I'm actively using. So please ask me not what's that and that. Won't answer something. Reporting and fixing bugs is just another story. Will completely cooperate in the bug fixing department. Have not really tested all new stuffs in this EA. Just really grateful to Sir Nico...
    Thanks for sharing the source code MZ. That is the way many folks should find out to code on their own and be self explanatory rather than relying on developers to make ex4 files which may die some time in the future leaving the trader hanging upside down!

  5. #5
    Quote Originally Posted by ;
    quote Thinking about implementing this in my own EA but won't help much for unidirectional trades. I have been a bit busy this week to fine-tune my old and loyal manual egy which I used to perform with FXCM on their TS2 to get USA.... And trying to replie the depart logic in mt4. I could manually trade over 200 transactions during events with important moves Here's my ask to see if there's a better performance-tuned alternative for my own exits within the context of accomplishing a Close-All @ %equity attained Open Trade Volume: could be over 2000 transactions to shut...
    Is the broker in the US or not?

  6. #6
    Quote Originally Posted by ;
    quote Is your broker in the US or not?
    Offshore ECN and Beloved:-(

  7. #7
    Perhaps not a coder here, however, with some experience with many orders shut by closures. One method to save a dollar or two would be to close by in a desired low spread. By way of instance if the spread is 0.5 pips normally, however it floats from 0.0 to 1.0, then setting 0.1 as a closure goal will slow down the speed of closures, not loading the broker host, cause 0.1 spread is happening not very often and not for much long.

    The problem here is the mt4 terminal gets heavy loaded while pursuing the 0.1 spread. Not sure why but it does. And 2k trades is a super heavy burden for the buggy terminal, already... It may become unaccessible for large pieces of time.

    Another alternative, could be, to shut by from a different terminal. Do not close by from the same terminals at which doing the trading.

  8. #8
    Quote Originally Posted by ;
    quote offshore ECN and unregulated:--LRB-
    I am not certain where the confusion will be then... Sum up all of your rankings and set one limit order of equivalent size in the opposite direction. All places instantly shut. Done. Then all you've got to do is reconcile them as closed either manually or programmatically. That is, afterall, how this script works.

  9. #9
    Quote Originally Posted by ;
    Not a coder here, but having some experience with many orders close by closures. 1 way to save a buck or two would be to close by in a desirable low spread. For example if the spread is 0.5 pips normally, however it floats from 0.0 to 1.0, then setting 0.1 as a closure goal will slow down the rate of closures, not loading the broker host, cause 0.1 spread is happening not very often and not for much long. The problem here is that the mt4 terminal has heavy loaded while pursuing the 0.1 disperse. Not sure why exactly, but it will. And 2k trades...
    Agree... I already have maxspread filters for entrances and exits

    dual MAX_SPREAD_ENTRY_FILTER= n.n; // (in pips) Input 999 to ignore spread widening. Assess for MAX_SPREAD_ENTRY_FILTER allowed before starting some places //
    dual MAX_SPREAD_EXIT_FILTER= n.n; // (in pips) Input 999 to ignore spread widening. Assess for MAX_SPREAD_EXIT_FILTER allowed before closing any places //

    I manually input and then EA takes over the aggressiveness when price goes in my leadership.... And provided that my average price is above/below the current bid/ask and as long as I have margin freeing up with floating profits, I continue adding on every tick... until my%equity goal is reached. Go big or Eat sh*t type of a deal (on a Tiny sub-account throughout events or special conditions... 1500% inside a 30-50 pip move:-

  10. #10
    Quote Originally Posted by ;
    quote I'm not sure where the confusion is then... Sum up all of your positions and set one limit order of equal size in the opposite direction. All places shut. Done. Then all you have to do is reconcile them as closed either manually or programmatically. That is, afterall, how this script works.
    That's great. I have not researched your script. My bad.... I assumed your script will work only with hedged places of same place size. Would it work exactly the same fashion in both the situations.... And FASTER/less overhead in contrast to loop and individually close each trade?

    0.1 minilot buy gt;gt; 0.1 minilot market
    1000 buy trades of varying sizes totaling 20lots gt;gt; one 23 lots sell
    varying lotsize and tradecount buy trades gt;gt; varying lotsize and tradecount sell transactions.... Your script will close only hedged trade sizes and depart the unhedged transactions open/floating?

    Keeping in mind that I'm not too worried of trading price.... Speed/execution/performance overhead is exactly what I'm concerned

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.