HedgeMultiCorrelation needs help - page 4

 

Well, we have to figure out the best take profit for each pair. If we close too soon we will have to recover the spread again. And if we close too late we must wait more for recovery.

But we are on the right track now

Sure this will be a lot better with large accounts, where you can assume some pontual drawdown, and continue to earn interest, but in small accounts we have to consider short take profits.

I think...

 

ok here is first version with mm added. it really doesn't work all that well. only opens 1 trade then will not open trade on second pair. figuring the mm was kind of tricky but i used some code from other ea's. maybe kokas u see what wrong with it. i think all settings are self explained. if not just ask and i try to answer. and remember i am no coder!!

Files:
 

Version 4 NOT STABLE!!!!!!!!

I have this version working right placing all the orders.

But I do not fully understand what you did with MM. Remember that we are placing two orders each time, not one like probably the EA you take the code from. Have you consider this?

Can you read the code and understand the logic? It would be great that you explain it to me.

I've also changed the default setings to a pair that is far more profitable with a single hedge strategie.

PS: For some strange reason the EA does not work with Ratio=1.5 and lotsize =0.1 ... I must had make some mistake... this is the only combination that I could find that do not work well. It places onle a trade for the first pair with MM disabled.

Maybe the problem is in this lines:

if(MoneyManagement) {

OrderLots1 = LotSize(); //Adjust the lot size

OrderLots2 = OrderLots1 * Ratio;

} else {

OrderLots1 = Lots;

OrderLots2 = Lots * Ratio;

}

I've changed it to:

if(MoneyManagement) {

OrderLots1 = NormalizeDouble(LotSize(),2); //Adjust the lot size

OrderLots2 = NormalizeDouble(OrderLots1 * Ratio,2);

} else {

OrderLots1 = NormalizeDouble(Lots,2);

OrderLots2 = NormalizeDouble(Lots * Ratio,2);

}

But still the same results.... Only one trade when ratio = 1.5 and Lot = 0.1

I do not know for sure, but here you have the EA it is working fine with default settings.

THIS VERSION IS NOT STABLE!!!!!

Files:
hegdeeav4.pdf  31 kb
hedgeea_v4.mq4  12 kb
 

Kokas

i think your last version 4

have for default :

lot =0.1

and

radio=1.5

what do you think about ?

 

This setup wont work...

I do not know why yet, but 0.1 and 1.5 wont work.

Thats why I put the version as unstable.

 

Ok, any idea why this line does not work with OrderLots2=0.15

I do not ave any clue about it:

OrderLots1=0.1;

OrderLots2=0.15;

OrderSend(Symbol1,OP_BUY,OrderLots1,MarketInfo(Symbol1,MODE_ASK),3,0,0,comment,Magic,0,Blue);

Print(Symbol1,"Lots: ", OrderLots1);

OrderSend(Symbol2,OP_SELL,OrderLots2,MarketInfo(Symbol2,MODE_BID),3,0,0,comment,Magic,0,Red);

Print(Symbol2,"Lots: ", OrderLots2);

The first order is placed the second nop...

 

Anyone has results to publish?

Well, my hard disk burn out this week and I've lost all statments, well, i do not lost them but do not know the account numbers and passwords where they are running...

this was a mess, hopefully I had uploaded the bug version first..

For now I do not think that version has a bug I believe that is a limitation of the accounts that I was demoing...

I'll begin new tests next week...

 

Volatility as a Clue

Volatility as a Clue

Most traders have heard the story of Long Term Capital Management (LTCM). For those who have not heard the story, LTCM was a hedge fund designed to take advantage of situations where the price volatility of a financial instrument would go from higher than average to normal (the mean). Can lowly traders such as ourselves take advantage of volatility as a warning that large moves are coming? The answer is yes. Most traders would agree that periods of high volatility are usually followed by periods of low volatility. But what about the other way around? Are periods of low volatility followed by periods of high volatility? They are indeed (most of the time). Today, we will briefly discuss a strategy that you can use to take advantage of volatility explosions.

Here is a quantified signal to take advantage of these occurrences. We are going to focus on getting clued in on volatility increases before they occur. Optimized historical tests have shown that it's effective to compare 6-day historically volatility against 100-day historical volatility. When 6-day historical volatility is 50% or less than 100-day volatility, this tells us that the stock or index has calmed down and it becomes likely that a large market move is about to happen. Keep this in mind if you are considering entering a straddle. You can use this technique to find ideal entry points. One extremely effective technique for entry is to find a stock that fits this low volatility criteria. Once the stock breaks out of a tight range (which should be in place based on low volatility), trade the stock in the direction of the breakout. So if the stock plummets downward, then sell short, and if the stocks shoots up, go long. Usually, the longer a stock or market index stays in this low volatility state, the larger the move will be once it breaks out.

You should use stops with this technique in the following way. Once you get a breakout following the period of low volatility, take note of the high of the breakout day if it is a bullish breakout. Once the stock closes above the high of the breakout day, then go long on the stock. Use the low of the breakout day as your stop loss price in order to reduce risk.

Price Headley is the founder and chief analyst of BigTrends.com.

Now! How to implement this on our EA?? This would improve a lot our strategy!

 

How to implement auto ratio...

Can we use this code to implement auto ratio on our EA?

We can set an option to UseAutoratio True/false ...

//+--------- --------- --------- --------- --------- --------- ----+

//+ Calculate cost in USD of 1pip of given symbol

//+--------- --------- --------- --------- --------- --------- ----+

double PipCost (string TradeSymbol) {

double Base, Cost;

string TS_13, TS_46, TS_4L;

TS_13 = StringSubstr (TradeSymbol, 0, 3);

TS_46 = StringSubstr (TradeSymbol, 3, 3);

TS_4L = StringSubstr (TradeSymbol, 3, StringLen(TradeSymb ol)-3);

Base = MarketInfo (TradeSymbol, MODE_LOTSIZE) * MarketInfo (TradeSymbol,

MODE_POINT);

if ( TS_46 == "USD" )

Cost = Base;

else if ( TS_13 == "USD" )

Cost = Base / MarketInfo (TradeSymbol, MODE_BID);

else if ( PairExists ("USD"+TS_4L) )

Cost = Base / MarketInfo ("USD"+TS_4L, MODE_BID);

else

Cost = Base * MarketInfo (TS_46+"USD" , MODE_BID);

return(Cost) ;

}

//+--------- --------- --------- --------- --------- --------- ----+

//+ Returns true if given symbol exists

//+--------- --------- --------- --------- --------- --------- ----+

bool PairExists (string TradeSymbol) {

return ( MarketInfo (TradeSymbol, MODE_LOTSIZE) > 0 );

}

PS: I've very sorry but I'm a little worried about my hard disk so i'm dumping here all the ideas that I have regarding the EA ...

 

hi all you hedgers

hi i have been playing with this idea for months too, it is a steady earner and collects swap all the way!!!

i have an ea of my own but i aint to hot so i will try yours

a good and simple entry point for the hedges would be to use 4h bb bands??

how has the demo testing been going?? here my hedge ea for yous to play with

Files:
Reason: