Trading on the exchange is netting and my advisor is only for hedging (as reported by the error printout when trying to connect to an exchange account:
I have the opposite: there is no connection in the exchange right now. And it will be like in that song:
You're a sailor, I'm a sailor.
You're a fisherman I'm a fisherman
You're on land I'm at sea
We'll never meet.
Added:
Trading on the exchange is netting and my advisor is only for hedging (as reported by the error printout when trying to connect to an exchange account:
No, I don't think that's a good approach: there are a lot of people, everyone likes different pairs and different timeframes. I'd rather prescribe it directly in the input parameters:
Ivan version "1.004":
entered variables
"Minimum distance from the price to stop loss (in pips)" - the minimum distance between the price and the Stop Loss level - if this distance is less, no position will be opened
for BUY - if one of the already opened BUY positions has an opening price lower than the current price - the BUY position will not be opened
for SELL position - if one of SELL position has an opening price higher than the current price - then SELL position will not be opened
Yes, that's much better. I optimized with your recommendations, I got as much as 50% for 2 weeks optimization, but when I ran the test for a month, I lost the same amount ))
now if no position of a given type was specified, a price of "0" will be returned - previously it was possible to return a DBL_MIN or DBL_MAX value.
Fixed the function to open a Buy position. An unfavourable variant was possible earlier - when several consecutive Buy positions were opened and each consecutive one was opened at a worse price than the previous one - in case of hitting the trend reversal it caused appreciable losses:
this has now been fixed (yes, yes, yes - the error was in the condition sign - previously it was a "<" sign:
return; } //--- the position of BUY can't be open below the lowest double price_open_low=FindPosition(POSITION_TYPE_BUY,MODE_LOW); if(price_open_low!=0) if(price_open_low> m_symbol.Ask()) return;
new input parameter"InpCoefProtectionProfit" - calculated as m_account.Equity()/m_account.Balance() (Funds divided by Balance).
When Equity exceeds the Balance by a factor of "InpCoefProtectionProfit" we close all positions - thus protecting the profit:
//--- we work only at the time of the birth of new bar staticdatetime dtPrevBars=0; //--- protection of profit if(m_account.Equity()/m_account.Balance()>InpCoefProtectionProfit) bCloseAll=true; //--- trailing stop (at every tick) if(!RefreshRates()) return; TrailingStop();
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
And immediately a test:
Ivan 1.004 USDJPY, M15, period 2016.01.01 to 2017.02.13
I'll make it like this for now:Ivan version "1.003":
The work is boiling - good!
However, I can't view the work yet - I don't have a forex account - only from the exchange, and the EA does not work there.
The work is boiling - good!
However, I can't see the work yet - I don't have a forex account - only from the exchange, and the advisor doesn't work there.
And I have the opposite: no connection to the exchange at the moment. And it will be like in that song:
You're a sailor, I'm a sailor.
You're a fisherwoman, I'm a fisherman.
You're on land, I'm at sea.
We'll never meet.
Added:
Trading on the exchange is netting and my advisor is only for hedging (as reported by the error printout when trying to connect to an exchange account:
). So the exchange is flying by with a whistle of plywood on Paris.
I have the opposite: there is no connection in the exchange right now. And it will be like in that song:
You're a sailor, I'm a sailor.
You're a fisherman I'm a fisherman
You're on land I'm at sea
We'll never meet.
Added:
Trading on the exchange is netting and my advisor is only for hedging (as reported by the error printout when trying to connect to an exchange account:
). So the exchange flies by with a whistle of plywood on Paris.
Yes, I understand, I just have Forex under 4 - maybe later I will open on demo - I will leave ideas if it will be interesting.
Teach me someone with a pro how to use the mt5 tester, I can't take much time in voice mode.
No, I don't think that's a good approach: there are a lot of people, everyone likes different pairs and different timeframes. I'd rather prescribe it directly in the input parameters:
Ivan version "1.004":
The work is boiling - good!
However, I can't look at the work yet - I don't have a Forex account - only from the stock exchange, and the advisor doesn't work there.
Ivan version "1.005":
{
if(m_position.PriceOpen()<price)
price=m_position.PriceOpen();
}
}
if(price==DBL_MIN || price==DBL_MAX)
price=0;
return(price);
}
this has now been fixed (yes, yes, yes - the error was in the condition sign - previously it was a "<" sign:
}
//--- the position of BUY can't be open below the lowest
double price_open_low=FindPosition(POSITION_TYPE_BUY,MODE_LOW);
if(price_open_low!=0)
if(price_open_low> m_symbol.Ask())
return;
sl=m_symbol.NormalizePrice(sl);
double tp=0.0;
Added:
Ivan version "1.006":
static datetime dtPrevBars=0;
//--- protection of profit
if(m_account.Equity()/m_account.Balance()>InpCoefProtectionProfit)
bCloseAll=true;
//--- trailing stop (at every tick)
if(!RefreshRates())
return;
TrailingStop();