Errori, bug, domande - pagina 970

 
Lizar:

IsStopped() aiuta a combattere il looping - questo è sicuro. Da qualche tempo il "ciclo perpetuo" non è curato daIsStopped() e, infatti, dobbiamo cancellare il processo terminale per ripristinare il funzionamento. Anche se l'indicatore di tipo viene eliminato dal grafico senza problemi, ma il grafico si blocca.

Per divertirvi, potete provare un indicatore con un loop speciale. A proposito, come si suppone in questo caso, OnDeinit() non funziona.

Fa paura anche solo eseguirlo)
 
zfs:
Fa paura anche solo eseguirlo).
E non c'è bisogno di eseguire quello che c'è nell'allegato. Questo è per coloro che vogliono provarlo. Ma, se si usano indicatori con calcoli pesanti, questo momento può influire. È necessario controllare.
 

Come inviare una richiesta (messaggio) dal client Android al client MetaTrader, ad esempio, per inviare una notifica

L'unico modo per farlo è piazzare un ordine pendente su un simbolo inutilizzato, e poi l'EA lo troverà, invierà un messaggio con le informazioni richieste e cancellerà l'ordine pendente.

 

Buon pomeriggio!

Nella build 19.04.13 il debugger ha iniziato a visualizzare il contenuto di MqlRate tra parentesi graffe. Grazie MQ per questo! Ci sono piani per rendere espandibile la visualizzazione di tali dati? Nel senso di sembrare un albero. Questo potrebbe essere esteso anche alle classi.

Grazie!

Per esempio:

CAbstractFilter{ meSS:CStrategySettings{ meEntrancePeriod:PERIOD_M15 meHistoryDepth:100 meSymbol: "EURUSD" meHistoryRates:[100] meRangeLimit:0.2 meHiLo:0.006 meHiLoMax:0.02 meTimeStart:" 06:00" meTimeEnd:" 20:00" meAsianStart:" 00:00" meAsianEnd:" 07:... }

Meglio:

CAbstractFilter:

+ { meSS:CStrategySettings

+ { { meEntrancePeriod:PERIOD_M15

meHistoryDepth:100

meSymbol: "EURUSD"

meHistoryRates:[100]

meRangeLimit:0.2}

e così via, simile alla struttura ad albero delle directory in Windows Explorer.

Grazie!

 

Ciao di nuovo!

Il passaggio al cursore sarebbe molto utile nel debugger. Speriamo che un giorno appaia. Apprezzo i vostri commenti in anticipo sulle possibili scadenze.

Grazie!

 

Qualcuno ha avuto un tale problema usando la libreria standard?

RF      0       19:42:38        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
RJ      0       19:42:38        Trades  '1001326': deal #204868 sell 1.00 ED-6.13 at 1.3058 done (based on order #2946444)
OQ      0       20:30:54        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DJ      0       20:30:55        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
FF      0       20:30:55        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DO      0       20:30:55        Trades  '1001326': deal #204952 buy 1.00 ED-6.13 at 1.3054 done (based on order #2946510)
FK      0       20:30:55        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
HG      0       20:30:55        Trades  '1001326': deal #204953 buy 1.00 ED-6.13 at 1.3054 done (based on order #2946511)
LO      0       20:30:55        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
NS      0       20:30:55        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
NK      0       20:30:55        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
LN      0       20:30:55        Trades  '1001326': deal #204954 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946512)
OR      0       20:30:56        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
EG      0       20:30:56        Trades  '1001326': deal #204955 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946513)
ME      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
IN      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
OI      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
JS      0       20:30:56        Trades  '1001326': deal #204956 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946514)
GO      0       20:30:56        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
NJ      0       20:30:56        Trades  '1001326': deal #204957 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946515)
JD      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
PO      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
HP      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
JJ      0       20:30:57        Trades  '1001326': deal #204958 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946516)
DM      0       20:30:57        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
RS      0       20:30:57        Trades  '1001326': deal #204959 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946517)
JI      0       20:30:57        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
GS      0       20:30:58        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
IM      0       20:30:58        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
OF      0       20:30:58        Trades  '1001326': deal #204960 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946518)
ID      0       20:30:58        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
KN      0       20:30:58        Trades  '1001326': deal #204961 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946519)
OP      0       20:30:58        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
QJ      0       20:30:58        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
QL      0       20:30:58        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
KG      0       20:30:58        Trades  '1001326': deal #204962 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946520)
NI      0       20:30:59        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
DO      0       20:30:59        Trades  '1001326': deal #204963 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946521)
PM      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DG      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
NQ      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
GJ      0       20:30:59        Trades  '1001326': deal #204964 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946522)
FH      0       20:30:59        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
KR      0       20:30:59        Trades  '1001326': deal #204965 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946523)
OL      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
IF      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
QH      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
CS      0       20:31:00        Trades  '1001326': deal #204966 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946524)
ME      0       20:31:00        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
KK      0       20:31:00        Trades  '1001326': deal #204967 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946525)
PP      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
DK      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
FE      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
ON      0       20:31:01        Trades  '1001326': deal #204968 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946526)
FL      0       20:31:01        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
KF      0       20:31:01        Trades  '1001326': deal #204969 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946527)
LH      0       20:31:01        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
KR      0       20:31:02        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
KD      0       20:31:02        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
HO      0       20:31:02        Trades  '1001326': deal #204970 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946528)
OQ      0       20:31:02        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
PD      0       20:31:02        Trades  '1001326': deal #204971 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946529)
MD      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
IO      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
OH      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
JR      0       20:31:02        Trades  '1001326': deal #204972 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946530)
GP      0       20:31:02        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
MM      0       20:31:03        Trades  '1001326': deal #204973 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946531)
JE      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
PN      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
HQ      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market
RK      0       20:31:03        Trades  '1001326': deal #204974 sell 1.00 ED-6.13 at 1.3052 done (based on order #2946532)
DL      0       20:31:03        Trades  '1001326': exchange sell 1.00 ED-6.13 at market placed for execution
GP      0       20:31:03        Trades  '1001326': deal #204975 sell 1.00 ED-6.13 at 1.3051 done (based on order #2946533)
CH      0       20:31:04        Trades  '1001326': exchange buy 1.00 ED-6.13 at market
OD      0       20:31:04        Trades  '1001326': exchange buy 1.00 ED-6.13 at market placed for execution
NN      0       20:31:04        Trades  '1001326': deal #204976 buy 1.00 ED-6.13 at 1.3055 done (based on order #2946534)

Ho provato a chiudere una posizione SELL, anche se il controllo di Expert Advisor è che prima si controlla il tipo di posizione.

if(PositionSelect(_Symbol) && PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
        {
         trade.PositionClose(_Symbol);

        }

Ho avuto un sacco di inversioni di posizione come risultato, fino a quando la mia richiesta è stata rapidamente eseguita

il codice Expert Advisor è in loop con uno slittamento di 300 ms

Il risultato -100 rubli.

Как использовать торговые классы Стандартной библиотеки при написании советника
Как использовать торговые классы Стандартной библиотеки при написании советника
  • 2010.11.10
  • Samuel
  • www.mql5.com
В статье рассказывается о том, как использовать основной функционал торговых классов Стандартной библиотеки при написании советников, в которых применяется открытие, закрытие и модификация позиции, проверка свободной маржи перед размещением торговых ордеров, размещение и удаление отложенных ордеров. Показано, как использовать торговые классы для получения свойств ордеров и сделок.
 
olyakish:

Qualcuno ha avuto problemi con questo?

il rake non è nella lib, perché riflette l'essenza dell'asincronia di MT5

Hai un rastrellamento nel tuo codice perché non hai fatto il blocco dei nuovi ordini fino a quando non ottieni la risposta sull'esecuzione dell'ordine precedente.

In MT5 si dovrebbe organizzare indipendentemente qualcosa di simile a Trade Context Busy per l'ordine inviato, come era in MT4.

Non dovresti fare nuovi tentativi di inviare un ordine simile finché non vedi il rapporto dell'esecuzione dell'ordine precedente.

Dovreste catturare l'esecuzione in OnTrade o OnTradeTransaction.

Buona fortuna. ;)

 

Mi sento pieno.

Nell'indicatore assegno un valore a una variabile.

#property indicator_separate_window

...

int x;//

int OnInit()

{

}

int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],const double &open[],
                const double &high[],const double &low[],const double &close[],const long &tick_volume[],
                const long &volume[],const int &spread[])
  {

 if(prev_calculated==0){

//при 1-м запуске присваиваю значение

x=у;//у!=7558445

}

else

{

Print(x);//здесь x уже =7558445.

}

}

Cosa sto facendo di sbagliato?

 
Ma ora va bene, anche se il codice non è stato cambiato. Ho appena riavviato il terminale. E questo bug è legato alla scomparsa dell'istogramma, di cui si è parlato prima, che appare e scompare. Da cosa può essere causato?
 
sergeev:

il rake non è nella lib, perché riflette l'essenza dell'asincronia di MT5

Hai un rastrellamento nel tuo codice perché non hai fatto il blocco dei nuovi ordini fino a quando non ottieni la risposta sull'esecuzione dell'ordine precedente.

In MT5 si dovrebbe organizzare indipendentemente qualcosa di simile a Trade Context Busy per l'ordine inviato, come era in MT4.

In altre parole, non dovresti fare nuovi tentativi di inviare un ordine simile finché non vedi il rapporto dell'esecuzione dell'ordine precedente.

Dovresti catturare l'esecuzione in OnTrade o OnTradeTransaction.

Buona fortuna. ;)

Sì, è quello che ho già pensato, dovrò fare qualche analisi supplementare. Grazie per aver confermato la mia ipotesi
Motivazione: