void ClosePositions()
{
for ( int i= PositionsTotal ()- 1 ;i>= 0 ;i--) // returns the number of current ordersif (m_position.SelectByIndex(i)) // selects the position by index for further access to its propertiesif (m_position. Symbol ()==m_symbol.Name() && m_position.Magic()==Magic)
m_trade.PositionClose(m_position.Ticket()); // close a position by the specified symbol
}
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
Şu anda her biri 1 lotluk 4 alış ve her biri 1 lotluk 4 satış var. Sembol aynı.
Bu formda sadece 1 alış 1 satış kapalıdır.
void CloseBy()
{
ulong ticket_buy= ULONG_MAX ;
ulong ticket_sell= ULONG_MAX ;
for ( int i= 0 ;i< PositionsTotal ();i++) // ATTENTION! Here, specially began a detour with "0"if (m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
{
if (m_position.PositionType()== POSITION_TYPE_BUY && ticket_buy== ULONG_MAX )
ticket_buy=m_position.Ticket();
if (m_position.PositionType()== POSITION_TYPE_SELL && ticket_sell== ULONG_MAX )
ticket_sell=m_position.Ticket();
}
if (ticket_buy!= ULONG_MAX && ticket_sell!= ULONG_MAX )
m_trade.PositionCloseBy(ticket_buy,ticket_sell);
//---return ;
}
Hiçbir şey böyle kapanmaz.
void CloseBy()
{
ulong ticket_buy= ULONG_MAX ;
ulong ticket_sell= ULONG_MAX ;
for ( int i= 0 ;i< PositionsTotal ();i++) // ATTENTION! Here, specially began a detour with "0"if (m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
{
if (m_position.PositionType()== POSITION_TYPE_BUY && ticket_buy== ULONG_MAX )
ticket_buy=m_position.Ticket();
if (m_position.PositionType()== POSITION_TYPE_SELL && ticket_sell== ULONG_MAX )
ticket_sell=m_position.Ticket();
}
if (ticket_buy!= ULONG_MAX && ticket_sell!= ULONG_MAX )
m_trade.PositionCloseBy(ticket_buy,ticket_sell);
//---//return;
}
4 alış ve 4 satışın hepsinin karşı tarafta kapalı olduğundan nasıl emin olunur?
Bir pozisyonu bulmak ve kapatmak için bu işlevi nasıl değiştireceğimi söyle AAA
Yardım: CPositionInfo
Metin özelliklerine erişiliyor...Teşekkür ederim.
Ayrıca, lütfen derlerken neden 'sayıdan' 'dize'ye örtük dönüştürmeye yemin ettiğini söyleyin.
if(m_trade.Buy(InpLots,m_symbol.Name(),m_symbol.Ask(),sl,tp,"AAA")
Bir satın alma komutu nasıl görünmelidir?
Teşekkür ederim.
Ayrıca, lütfen derlerken neden 'sayıdan' 'dize'ye örtük dönüştürmeye yemin ettiğini söyleyin.
if(m_trade.Buy(InpLots,m_symbol.Name(),m_symbol.Ask(),sl,tp,"AAA")
Bir satın alma komutu nasıl görünmelidir?
Yardım: Satın alın .
Yardım: Koşullu if-else ifadesi
Kodu yanlış yazdım.
İşte kod
Derleyici "AAA" +chislo'ya yemin ediyor
Kodu yanlış yazdım.
İşte kod
Derleyici "AAA" +chislo'ya yemin ediyor
Yardım: IntegerToString
Eklendi: Bugünlük bu kadar. Ben zaten uyuyorum.
Kodu yanlış yazdım.
İşte kod
Derleyici "AAA" +chislo'ya yemin ediyor
Vladimir Karputov, Alexey Viktorov
teşekkürler
Bana kodu söyle lütfen.
Şu anda her biri 1 lotluk 4 alış ve her biri 1 lotluk 4 satış var. Sembol aynı.
Bu formda sadece 1 alış 1 satış kapalıdır.
Hiçbir şey böyle kapanmaz.
4 alış ve 4 satışın hepsinin karşı tarafta kapalı olduğundan nasıl emin olunur?