MQL4 - automated forex trading   /  

Code Base

ODL Securities

Code Base  Expert Advisors  SMA MultiHedge To post a new code, please log in or register

This Expert Advisor is for
MetaTrader 4
Download MT 4 - 3.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
SMA MultiHedge
Author: vixenme (2006.12.08 17:54)
Rating: 7
Downloaded: 12278
Download:
 SMA_MultiHdege2.mq4 (27.3 Kb) View

How It Works?  Let me explain like this (the concept is symple):

    -  play GBPUSD as a BaseSymbol and if SMA is heading up;

    -  go long GBPUSD and hedge EURUSD short to reduce the risk but i also hedge USDCHF long too that's it;

    -  then due to the EA let me show an example;

    -  set the avilable hedge symbol to 3 , EURUSD-USDCHF-USDJPY as defalt if you dont want to hedge USDJPY just set "HedgeH3" to false but if you want to hedge USDJPY

    -  set "H3.followBase" to true (default) if you want to send order the same way of GBPUSD;

    -  set "H3.followBase" to false if you want to send order the opposite way of GBPUSD with "H3.LotsRatio" =2 ,as default, that will send the order twice in lot-size of GBPUSD. BUT the hedge of GBPUSD-USDJPY will execute only when the correlation between GBPUSD-USDJPY is pass the "H3.Expect.CorRelation" value.

    -  if you expect -0.90 they will be sent only when correlation is less than -0.90 and either;

    -  if you expect 0.90 they will be sent only when correlation is greater than 0.90 and dont worry each hedge work separately with MagicNo,MagicNo+1 and MagicNo+2. So please change the "MagicNo" to something differrent like 318 if you want to play another pair as BaseSymbol.

       Last thing:

    -  each hedge will be closed when overall profit is greater than "Expect.Profit" and dont worry about the swap. This EA can auto calculate the profit from swap

    -  if your hedge can make profit from swap the EA will not mention swap only close hedge when reach"Expect.Profit";

    -  BUT if your hedge cant make profit from swap the ea will close hedge when total profit (real + swap) is reach"Expect.Profit".


Because of this kind of EA can not test by backtesting so the result is still in forwardtesting process and i've got only this picture:




Enjoy!

12 comments: 1 2   To post a new comment, please log in or register

I tried this one again, and it wiped out pretty hard.

http://www.pipcop.com/forums/showthread.php?t=15

03.10.2008 01:17 PocoDiablo
Unfortunately, in testing, this EA does well for a while and then posts MASSIVE losses (for example, $30 - $60 profits, then suddenly a $4000 loss) so I rate this as a "1".
09.08.2008 04:10 PocoDiablo

Hi vixenme,


Is there defined any StopLoss on this EA ? If yes, what variable is that?


Regards,

puncher

09.07.2008 18:25 puncher
FXIA wrote:
This EA is good from the testing I did but it loses huge amounts for me, it needs a filter for when not to trade certain currency based on price ranges or something, I have a hedge EA that has this coded into it and it is very profitable.

hi FXIA!what filter do you using?
25.02.2008 15:22 art0980
This EA is good from the testing I did but it loses huge amounts for me, it needs a filter for when not to trade certain currency based on price ranges or something, I have a hedge EA that has this coded into it and it is very profitable.
16.02.2008 00:58 FXIA

vixenme,

What is the best TimeFrame for tihis EA ??

thank you

01.11.2007 15:07 bedaine
barakah wrote:

Fantastic idea.

I think to wonder if what you are doing is correct, we have to understand what is the meaning of hedge.

Google search showed me: In finance, a hedge is an investment that is taken out specifically to reduce or cancel out the risk in another investment.
Different strokes for different folks.

I have not used an EA before so i have a few questions which you are able to answer, but if its too simple, you can point me to the right
link which have answers which i would be grateful, thanks in advance. Happy pipping.

1. How do we use or activate the EAs, do we have to drag it into 3 charts?
2. Does EA perform even when we have shutdown our computer? (laughs at self, simple question if you have used it b4,... not me. lol)

A hedge is a divosor, and any time you trade on both sides of the hedge, you are hedging. The most common use of hedging is the description you found in google, but if you simply took a buy and a sell at the same time for whatever reason you are hedging. Hes using it for the purposes of making money off interest rate differentials.
16.10.2007 09:33 faqcya
just set "TradeAllow" to true.

sorry that's my fault.
14.06.2007 17:10 vixenme
Vixenme,

Not a coding expert yet, however I am learning and really like hedge trading strategies. I think this one appears 'interesting'. Loaded this EA up last week and could not get it to open a trade. I am pretty familier ith most of the 'usual' things that prevent an EA from taking trades, but his one has me stumped OR maybe is was just not a good week for this EA. Is H1 timeframe what you recommend?, I used that, maybe that is my problem. Thoughts?

Thanks.

Beaker
04.02.2007 19:37 Beaker
Just curious, Vixenme, if you happen to have more of your forward testing data since December.
Just that little sample of time is interesting and I am going to open a demo and let it run to see what results it gives.
But, it would be nice to see what you have gathered over the past 2 months, also.   Thank you if you can provide it.
04.02.2007 11:50 asmocon