Now I will try to replace this function with this one
//+------------------------------------------------------------------+//| Check for long position opening |//+------------------------------------------------------------------+bool CSampleExpert::LongOpened(void)
{
bool res=false;
//--- check for long position (BUY) possibility
{
double price=m_symbol.Ask();
double tp =m_symbol.Bid()+m_take_profit;
//--- check for free moneyif(m_account.FreeMarginCheck(Symbol(),ORDER_TYPE_BUY,InpLots,price)<0.0)
printf("We have no money. Free Margin = %f",m_account.FreeMargin());
else
{
//--- open positionif(m_trade.PositionOpen(Symbol(),ORDER_TYPE_BUY,InpLots,price,0.0,tp))
printf("Position by %s to be opened",Symbol());
else
{
printf("Error opening BUY position by %s : '%s'",Symbol(),m_trade.ResultComment());
printf("Open parameters : price=%f,TP=%f",price,tp);
}
}
//--- in any case we must exit from expert
res=true;
}
//--- resultreturn(res);
}
//+------------------------------------------------------------------+//| Check for short position opening |//+------------------------------------------------------------------+bool CSampleExpert::ShortOpened(void)
{
bool res=false;
//--- check for short position (SELL) possibility
{
double price=m_symbol.Bid();
double tp =m_symbol.Ask()-m_take_profit;
//--- check for free moneyif(m_account.FreeMarginCheck(Symbol(),ORDER_TYPE_SELL,InpLots,price)<0.0)
printf("We have no money. Free Margin = %f",m_account.FreeMargin());
else
{
//--- open positionif(m_trade.PositionOpen(Symbol(),ORDER_TYPE_SELL,InpLots,price,0.0,tp))
printf("Position by %s to be opened",Symbol());
else
{
printf("Error opening SELL position by %s : '%s'",Symbol(),m_trade.ResultComment());
printf("Open parameters : price=%f,TP=%f",price,tp);
}
}
//--- in any case we must exit from expert
res=true;
}
//--- resultreturn(res);
}
//+------------------------------------------------------------------+
Yes. It's your dealer-Forexclub for them order type FilingFock. I'll take a walk with the dog and fix it. Didn't think there was anyone else on forexclub...
Свойства ордеров - Торговые константы - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Yes. It's your dealer-Forexclub for them to have a FilingFoc order type. I'll take a walk with the dog and fix it. Didn't think there was anyone else on forexclub...
Filling mode should be set by the rules, not from the name of the forex dealer.
Yes. It's your dealer-Forexclub for them to have a FilingFoc order type. I'll take a walk with the dog and fix it. Didn't think there was anyone else on forexclub...
Didn't notice - surely you have a broker still here
I'm going to try to replace this function with this one.
You don't have to.
The 119th line should be if (AccountInfoString(ACCOUNT_COMPANY)=="Alpari" || AccountInfoString(ACCOUNT_COMPANY)=="Forex Club International Limited") TypeFilling = ORDER_FILLING_FOK;
The 119th line should be if (AccountInfoString(ACCOUNT_COMPANY)=="Alpari" || AccountInfoString(ACCOUNT_COMPANY)=="Forex Club International Limited") TypeFilling = ORDER_FILLING_FOK;
and the same for AUTOOrderSELL. THAT'S IT. :)
I will leave it this way for now - I will correct it after the test
Sets the order type according to the settings of the specified symbol
Thank you very much. I should use automatic mode but I couldn't find it. That's why I prepared this patch as simple instructions for broker which one I have to use :) They are only 2. Remake. Thank you.
Good morning!
The tester does not want to open a position, it generates an error
ERR_TRADE_SEND_FAILED
4756
Failed to send trade request
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I think something should be corrected here
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Now I will try to replace this function with this one
Good morning!
The tester does not want to open a position, it generates an error
ERR_TRADE_SEND_FAILED
4756
Failed to send trade request
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I think something needs to be fixed here.
Yes. It's your dealer-Forexclub for them order type FilingFock. I'll take a walk with the dog and fix it. Didn't think there was anyone else on forexclub...
Yes. It's your dealer-Forexclub for them to have a FilingFoc order type. I'll take a walk with the dog and fix it. Didn't think there was anyone else on forexclub...
Filling mode should be set by the rules, not from the name of the forex dealer.
Added.
You can see an example in the CTrade trade class
SetMarginMode
Sets the mode of margin calculation according to the current account settings
SetTypeFillingBySymbol
Sets the order type according to the settings of the specified symbol
Yes. It's your dealer-Forexclub for them to have a FilingFoc order type. I'll take a walk with the dog and fix it. Didn't think there was anyone else on forexclub...
Didn't notice - surely you have a broker still here
It's working.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
swapped -----------
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Seems to be working fine so far.
It's working.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
swapped -----------
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Seems to be working fine so far.
as it is pre-tested with algorithm, I wonder if the result is the same?
I'm still testing on a one minute test - my computer is weak, so testing is slow.
It looks good at first glance - let's see what the end result looks like.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
no errors in Expert's tester
Good morning!
The tester does not want to open a position and gives an error
ERR_TRADE_SEND_FAILED
4756
Failed to send trade request
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I think something should be corrected here
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I'm going to try to replace this function with this one.
You don't have to.
The 119th line should be if (AccountInfoString(ACCOUNT_COMPANY)=="Alpari" || AccountInfoString(ACCOUNT_COMPANY)=="Forex Club International Limited") TypeFilling = ORDER_FILLING_FOK;
and the same for AUTOOrderSELL. THAT'S IT. :)
No need.
The 119th line should be if (AccountInfoString(ACCOUNT_COMPANY)=="Alpari" || AccountInfoString(ACCOUNT_COMPANY)=="Forex Club International Limited") TypeFilling = ORDER_FILLING_FOK;
and the same for AUTOOrderSELL. THAT'S IT. :)
I will leave it this way for now - I will correct it after the test
- don't want to stop the tester
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
the only bad thing is that the test is going on now - and i seem to be overdoing it here
Fill mode should be set by the rules, not from the name of the forex dealer.
Added.
You can see an example in the CTrade trade class
SetMarginMode
Sets the mode of margin calculation in accordance with the current account settings
SetTypeFillingBySymbol
Sets the order type according to the settings of the specified symbol
Thank you very much. I should use automatic mode but I couldn't find it. That's why I prepared this patch as simple instructions for broker which one I have to use :) They are only 2. Remake. Thank you.