The Trade Panel Returns (remember the Hedge Trade panel?) | Forex Factory

HeroPoker_HeroPoker扑克_HeroPoker德扑圈官网

Attachments: The Trade Panel Returns (remember the Hedge Trade panel?)

The Trade Panel Returns (remember the Hedge Trade panel?)

Hi Guys,

Some years back I made a trade panel which had some unique features.
(you will find a new version in post 8 below and there are various other versions in the attachments section of this thread)
Hedge Trade-panel | Forex Factory
I’m still using it but I wanted to make something different so I decided to make a new trade panel and I'm sharing it here.
The main difference is that the new panel is calculating SL and TP and distance to stop orders and limit orders using the daily range of the currency pair,
plus that it is moveable to anywhere on the chart. (to move it double click on the = button and drag and drop the button anywhere on the chart, then the panel will follow)

The EA will automatically place a SL Or a stop order Or it will auto hedge to protect our main trade.
These options are available through input "SL TYPE" . If we do a partial trade closure and the size of our main trade is reduced then the EA will close the initial stop order and open a new one at the reduced lot size.
There is an input for switching between SL mode and Stop Order mode. The button APPLY SL/TP is not really needed but it is there for extra protection in case the EA is slow at opening a new stop order or applying the SL.
The CLOSE BUY and CLOSE SELL buttons will only close the market orders and not the protecting stop orders but if a market stop order closes then its paired stop order will close automatically.

The lot size can be fixed or it can be calulated automatically using risk % and equity. I use Risk% because I don't have to keep adjusting my trade size as my account equity fluctuates. The lot size is displayed in the info window (Lot 0.23). The open positions are also displayed there (Pos 0.00)but please note that these are net positions (Buy orders + sell orders cancel each other out so we see our net exposure)There is no hedging button because I would never use it but I kept the OrderCloseBy method (Read the pdf, its useful when trading large size) and I linked it to the CLOSE ALL button (there is an input for enabling this function). I find this feature particularly useful when I have a basket of open trades (which might take a while to close) and I want to preserve profit. Plus during news events or high volatility when 1 second we are +$5K and the next second +$2K or even 0.

I'm also attaching a PDF with an AI generated example on how the function OrderCloseby will work with 10 open trades and explains the benefits

EDIT Jan 28 2026
Updated Panel Version 2.82 (See Post 7 below)

  1. Added Diagnostics input
  2. Added Spread to the info panel
  3. Added 3 types of trailing stop, the default selection is B but I prefer the ADR type (selection C)
  4. Added hedging option.

If we press the HEDGE ALL button the EA will place a hedging order of matching trade size for each open MARKET ORDER and will delete the protecting stop orders.
If we later decide to close the hedge order, the EA will place a fresh STOP ORDER

SL TRADE PANEL V2.84
The Magic number is now shown in the info panel and the pip readings are now compensated for Gold and Indices.
I have added the AUTO HEDGE feature of V34 to this trading panel and it is enabled/disabled through the SL type input
It is option 3= selection: SL_TYPE_AUTO_HEDGE
There is also a 4th SL option in this input which allows us to disable all SL

AUTO HEDGING in V2.84
When Auto Hedging is enabled the EA is using magic Number shift, so once the 2 trades are hedged they are no longer managed by the EA because it will change its magic number ( Unless you change the EA input and select" Manage own Trades=false)
If you close 1 of the 2 hedged trades and change the input SL type to " SL_TYPE_STOP_ORDER" the EA will place a STOP ORDER to protect the open trade.
If you close 1 of the 2 hedged trades and change the input SL type to " SL_TYPE_NORMAL" the EA will place a STOP LOSS to protect the open trade.
If you close 1 of the 2 hedged trades and change the input SL type to " SL_TYPE_NONE" the EA will not place a SL or a STOP ORDER, the remaining open trade stays unprotected

EDIT 9 Feb 2026
Added Updated Hedge Panel 34D (changed Gold pip calculation).


EDIT 10 Feb 2026
Added Updated Hedge Panel V34E and SL Trade Panel V2.84E (Fixed Auto hedging bug for Gold and set the input" Manage own trades"=false).

Attached Image(s) (click to enlarge)
Click to Enlarge

Name: Untitled.png
Size: 4 KB
Click to Enlarge

Name: V34E.png
Size: 4 KB
Attached File(s)
File Type: pdf OrderCloseBy Example.pdf   77 KB | 67 downloads
File Type: mq4 HedgeTradePanel34E + GOLD.mq4   96 KB | 15 downloads | Uploaded Feb 10, 2026 1:28am
File Type: mq4 ADR BASED TRADE PANEL V2.84E.mq4   186 KB | 20 downloads | Uploaded Feb 10, 2026 1:28am
Have a nice day
Hi Guys, Some years back I made a trade panel which had some unique features. (you will find it in the attachments of this thread) Hedge Trade-panel | Forex Factory I抦 still using it but it wasn't very stable so I decided to make a new trade panel and I'm sharing it here. The main difference is that the new panel is calculating SL and TP and distance to stop orders and limit orders using the daily range of the currency pair, plus that it is moveable to anywhere on the chart....
The OrderCloseBy feature allowing trades to close netted with legs closed for swop issues etc most will never work it out even those actively hedging/nedging on the same pair.
{quote} The OrderCloseBy feature allowing trades to close netted with legs closed for swop issues etc most will never work it out even those actively hedging/nedging on the same pair.
I don't follow you, maybe the code logic was wrong in your situation? please explain?
Have a nice day
{quote} I don't follow you, maybe the code logic was wrong in your situation? please explain?
No, Nicholishens original use for hedging with ordercloseby unless your trade panel is completely seperate from that, in that case I can withdraw my comment.
Most traders won't understand the benefit of using Ordercloseby.
{quote} No, Nicholishens original use for hedging with ordercloseby unless your trade panel is completely seperate from that, in that case I can withdraw my comment. Most traders won't understand the benefit of using Ordercloseby.
I only referenced the Nicholishen's thread because I had some attachments in there and I'm not recommending to use his code.
I'm not sure what code he used at the time but I didnt like it because his code and his use of mqh files to create the panel structure had some issues so I moved on.

My panel has evolved a lot since then, I was up to version 36 but I didn't share it because some of the source code belonged to a friend.
Coming back to your comment on OrderCloseby I have not noticed any problems using the code I have already used in my old trade panel and I used it in several EAs but I will give it a good test again on Monday
Have a nice day
{quote} I only referenced the Nicholishen's thread because I had some attachments in there and I'm not recommending to use his code. I'm not sure what code he used at the time but I didnt like it because his code and his use of mqh files to create the panel structure had some issues so I moved on. My panel has evolved a lot since then, I was up to version 36 but I didn't share it because some of the source code belonged to a friend. Coming back to your comment on OrderCloseby I have not noticed any problems using the code I have already used in...
We抮e on crossed lines!
Im not saying there is any issues with your code, far from it.
Just saying ordercloseby used correctly with hedging/netting etc can be extremely useful as you explained within your first post.
Updated Panel Version 2.82

  1. Added Diagnostics input
  2. Added Spread to the info panel
  3. Added 3 types of trailing stop, the default selection is B but I prefer the ADR type (selection C)
  4. Added hedging option.

If we press the HEDGE ALL button the EA will place a hedging order of matching trade size for each open MARKET ORDER and will delete the protecting stop orders.
If we later decide to close the hedge order, the EA will place a fresh STOP ORDER

Attached File(s)
File Type: mq4 ADR BASED TRADE PANEL V2.82.mq4   150 KB | 55 downloads
Have a nice day
I'm Adding 2 EA versions which I have prepared for trading Forex+ Gold.
One of the original Auto Hedge Panel EA's V34C plus the newer Trade panel V2.84

HEDGE PANEL 34C
Many people already know HedgePanel V34, the main difference between V34 and V34C is that the new version is not using external mqh files(all mqh code is combined in the EA)
A member asked me to add some logic to work with Gold ( because the hedging distance in the old version was too close).
I have not tested this feature on Gold yet, so someone please test this "auto hedging" feature on Gold and let me know if there are any issues.

ADR TRADE PANEL V2.84
The Magic number is now shown in the info panel and the pip readings are now compensated for Gold and Indices.
I have added the AUTO HEDGE feature of V34 to this trading panel and it is enabled/disabled through the SL type input
It is option 3= selection: SL_TYPE_AUTO_HEDGE
There is also a 4th SL option in this input which allows us to disable all SL

AUTO HEDGING in V2.84
When Auto Hedging is enabled the EA is using magic Number shift, so once the 2 trades are hedged they are no longer managed by the EA because it will change its magic number ( Unless you change the EA input and select" Manage owne Trades=false)
If you close 1 of the 2 hedged trades and change the input SL type to " SL_TYPE_STOP_ORDER" the EA will place a STOP ORDER to protect the open trade.
If you close 1 of the 2 hedged trades and change the input SL type to " SL_TYPE_NORMAL" the EA will place a STOP LOSS to protect the open trade.
If you close 1 of the 2 hedged trades and change the input SL type to " SL_TYPE_NONE" the EA will not place a SL or a STOP ORDER, the remaining open trade stays unprotected
Attached File(s)
File Type: mq4 HedgeTradePanel34C + GOLD.mq4   96 KB | 31 downloads
File Type: mq4 ADR BASED TRADE PANEL V2.84B.mq4   185 KB | 35 downloads
Have a nice day