HedgeEA - page 39

 

Stevensign , as you know i play what if with your hedge advisor lots and i whould like to ask if the indicator calculate the spread that we paid every time that we tack profit and open new trades?

 
Stevensign:
I'm aware of this problem, I think I understand it, at least I do have a fix.

The problem is because the EA is executed only once per tick of the currency it's attached to, so you can see the profit on your tradestation reach its target but if there aren't any ticks on the chart your EA is attached to, the EA won't see it.

I use an EA that just does cash grabs (you could probably just set the Hedge EA to not open any trades) and I put a copy on each of the Currency pairs I have trades in. I've tried puting it on the cross pair, that helps but it's not as succesful as putting an EA on each chart.

You could try writing a script that never exits (an infinite loop) but that would probably lock up your computer. since scripts are executed immediately but only once.

After rereading your question, this may not be the solution.

Another problem I had was making sure to use the RefreshRates command just before the EA checks profit.

Let me know what you think.

the issue that you are describing is when the profit target is actually reached but the EA does not see it because the chart it is attached to did not get a new tick.

what i saw is that the profit target was not actually reached but the EA thougth that it was. it happened on the first gap tick on jan 2. the symbol to which the EA was attached to went into profit due to the gap. this profit, in of itself, met the profit target. the other symbol, which also gapped, was not read in the EA -- which if it were would not have resulted in a closure because the addition of the two would still have had a loss.

the only thing i can think of right now that did this is that the second symbol had a temporary freeze due to the volatile gap and it's current bid was not read in the EA of the first symbol.

see post 378 above

 
dcraig:
Hi bodshyipmonitor, I may be wrong, but it would appear you've put almost 90% of your capital at risk.

Yeap.

I realise that.

how do we code something in MT4 to calculate the lots.

like for eg. i wish to risk 20% of my USD1000.

i always saw in alot of EA, they does this

Lots = AccountBalance() * 20/100/1000;

Seriously, I have totally no idea when they divide 1000.

And shouldn't the EA take the AccountLeverage() into account?

How do we put everything together? Balance, Risk and Leverage.

Hope someone could answer this.

 
Stevensign:
I'm aware of this problem, I think I understand it, at least I do have a fix.

The problem is because the EA is executed only once per tick of the currency it's attached to, so you can see the profit on your tradestation reach its target but if there aren't any ticks on the chart your EA is attached to, the EA won't see it.

I use an EA that just does cash grabs (you could probably just set the Hedge EA to not open any trades) and I put a copy on each of the Currency pairs I have trades in. I've tried puting it on the cross pair, that helps but it's not as succesful as putting an EA on each chart.

You could try writing a script that never exits (an infinite loop) but that would probably lock up your computer. since scripts are executed immediately but only once.

After rereading your question, this may not be the solution.

Another problem I had was making sure to use the RefreshRates command just before the EA checks profit.

Let me know what you think.

My suggestion is extract the AutoProfit Script and place it all the Pairs.

So whenever u receive a tick, the EA will work almost immediately.

or maybe something like a timer to check the balance every sec.. once the balance hit a certain target, it would close the trades. :P

 
400396:
Stevensign , as you know i play what if with your hedge advisor lots and i whould like to ask if the indicator calculate the spread that we paid every time that we tack profit and open new trades?

If I understand your question the answer is yes, my hedge indicator (I didn't write the advisor that has been posted) takes spread into account. The values at each candle are the net profit or loss from your entry point. The swap is separate, I've multiplied the swap value by -1 just to make it easy to see when you're in net profit including the swap, whenever the histogram is above the yellow swap line, you're in profit.

I'm not sure if that answers your question.

 
Stevensign:
If I understand your question the answer is yes, my hedge indicator (I didn't write the advisor that has been posted) takes spread into account. The values at each candle are the net profit or loss from your entry point. The swap is separate, I've multiplied the swap value by -1 just to make it easy to see when you're in net profit including the swap, whenever the histogram is above the yellow swap line, you're in profit. I'm not sure if that answers your question.

possible to release the source file for Hedge Indicator v03.ex4??

 

yes ,thank you.

another question , i have test for 2 weeks the AUDUSD AND AUDJPY ,the reason I'm interesting in this pair is that we get there nice swap and the correlation look fine and the margin is half (from the majors)

how you will calculate the ratio of this pair ? or just use 1 lot from each pair.

Stevensign:
If I understand your question the answer is yes, my hedge indicator (I didn't write the advisor that has been posted) takes spread into account. The values at each candle are the net profit or loss from your entry point. The swap is separate, I've multiplied the swap value by -1 just to make it easy to see when you're in net profit including the swap, whenever the histogram is above the yellow swap line, you're in profit. I'm not sure if that answers your question.
 

Hedge Indicator v05

bodshyipmonitor:
possible to release the source file for Hedge Indicator v03.ex4??

I'm sorry I can't release the source code yet. I'm working on this indicator with a team of people. It contains some concepts and code that are proprietary right now.

I've attached a newer version. (It's pretty amazing) Sorry I don't have the documentation written yet. if the first three conditons are false you can manually enter prices and lots. if you set calculate from now to true, it will recalculate every time you change time period. It may be best on M5 or M15.

Later...

Files:
 

Audusd Audjpy

400396:
yes ,thank you.

another question , i have test for 2 weeks the AUDUSD AND AUDJPY ,the reason I'm interesting in this pair is that we get there nice swap and the correlation look fine and the margin is half (from the majors)

how you will calculate the ratio of this pair ? or just use 1 lot from each pair.

For USD lot normalization AUDUSD = 1.0; AUDJPY must be multiplied by USDJPY factor , use 1.19 (practice opening and closing an order to verify it's $1 per pip.

Daily range: AUDUSD = 54 PIPs; AUDJPY = 58 so multiply AUDUSD by 58/54=1.07

So your final settings are AUDUSD 1.07 and AUDJPY 1.19 or a ratio of 0.9.

Let me know if that seems correct, the goal, or at least my goal, is to balance the hedge.

 

thanks Stevensign, i will test it with my demo and let you know how this works.

you said a couple of days ago that you will post the indicator so we can test other pairs any news on that?

does any one hedge the GBP\USD USD\JPY? I'M DRAWDOWN this hedge for $2000 .

Stevensign:
For USD lot normalization AUDUSD = 1.0; AUDJPY must be multiplied by USDJPY factor , use 1.19 (practice opening and closing an order to verify it's $1 per pip.

Daily range: AUDUSD = 54 PIPs; AUDJPY = 58 so multiply AUDUSD by 58/54=1.07

So your final settings are AUDUSD 1.07 and AUDJPY 1.19 or a ratio of 0.9.

Let me know if that seems correct, the goal, or at least my goal, is to balance the hedge.
Reason: