Ti stai perdendo delle opportunità di trading:
- App di trading gratuite
- Oltre 8.000 segnali per il copy trading
- Notizie economiche per esplorare i mercati finanziari
Registrazione
Accedi
Accetti la politica del sito e le condizioni d’uso
Se non hai un account, registrati
Vladimir, l'ha capito e l'ha fatto funzionare. Dove posso scambiare ordini di vendita con ordini di acquisto qui?
Ogni modulo segnali ha due funzioni, che sono utilizzate per emettere segnali di acquisto o di vendita. Questi sono "LongCondition" e "ShortCondition".
Ogni modulo segnali ha due funzioni, che vengono utilizzate per emettere segnali di acquisto o di vendita. Questi sono "LongCondition" e "ShortCondition".
Ho capito che nella vostra EA questi sono:
{
int result=0;
int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(m_reverse)
if(DiffCloseMA(idx)>0.0)
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
if(!m_reverse)
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
//--- return the result
return(result);
}
//+------------------------------------------------------------------+
//| "Voting" that price will fall. |
//+------------------------------------------------------------------+
int CSignalMA::ShortCondition(void)
{
int result=0;
int idx =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(m_reverse)
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
if(!m_reverse)
if(DiffCloseMA(idx)>0.0)
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
//--- return the result
return(result);
}
//+------------------------------------------------------------------+
e dov'è la linea che è responsabile dell'azione? E come posso cambiare questa proprietà?
Capisco che nella vostra EA questo sia:
{
int result=0;
int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(m_reverse)
if(DiffCloseMA(idx)>0.0)
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
if(!m_reverse)
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
//--- return the result
return(result);
}
//+------------------------------------------------------------------+
//| "Voting" that price will fall. |
//+------------------------------------------------------------------+
int CSignalMA::ShortCondition(void)
{
int result=0;
int idx =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(m_reverse)
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
if(!m_reverse)
if(DiffCloseMA(idx)>0.0)
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
//--- return the result
return(result);
}
//+------------------------------------------------------------------+
e dov'è la linea che è responsabile dell'azione? E come posso cambiare questa proprietà?
Inserisci il codice correttamente:Inserisci il codice correttamente nel forum
Lei ha citato il codice NON DAL CODICE, ma dal MODULO DEI SEGNALI.
Non c'è bisogno di cambiare qualcosa nel mio modulo per cambiare la direzione del segnale, perché ha l'impostazione "Reverse" - a seconda del valore che ha (vero o falso) i segnali possono essere invertiti direttamente.
Usando l'esempio "LongCondition":
se l'inverso ("m_reverse") è vero e il prezzo di chiusura meno il valore dell'indicatore è maggiore di zero - allora diamo il segnale "Long" (Buy, compra)
{
int result=0;
int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(m_reverse)
if(DiffCloseMA(idx)>0.0)
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
if(!m_reverse)
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
//--- return the result
return(result);
}
Inserisci correttamente il codice:Inserisci correttamente il codice nel forum
NON hai incollato il codice dall'ADVISOR, ma dal SIGNAL MODULE.
Non c'è bisogno di cambiare nulla per cambiare la direzione del segnale nel mio modulo, perché ha l'impostazione "Reverse" - a seconda di quale valore ha (vero o falso) i segnali possono essere invertiti direttamente.
Usando l'esempio "LongCondition":
se "m_reverse" è vero e il prezzo di chiusura meno il valore dell'indicatore è maggiore di zero - allora il segnale è "Long" (Buy, compra)
{
int result=0;
int idx=StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(m_reverse)
if(DiffCloseMA(idx)>0.0)
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
if(!m_reverse)
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
}
//--- return the result
return(result);
}
Vladimir, c'è un nuovo problema. Il tuo Expert Advisor è stato compilato, ma quando provo a trascinarlo sul grafico e mi accordo con le impostazioni. Vedo un'icona nell'angolo destro che mostra che l'Expert Advisor è stato lanciato. Poi scompare subito. Quale può essere la ragione? Questa retromarcia è buona. Come può essere applicato in altri EA?
Vladimir, c'è un nuovo problema. Il tuo EA è stato compilato, ma quando provo a trascinarlo su un grafico e mi accordo con le impostazioni. Vedo un'icona nell'angolo destro che dice che l'EA sta girando per un po'. Poi scompare subito. Quale può essere la ragione? Questa retromarcia è buona. Come può essere applicato ad altri EA?
Cercate i messaggi di errore nella finestra "Toolbox" del terminale nelle schede "Experts" e "Journal"...
Ho capito che questa è la sezione che è responsabile dell'apertura di una posizione se "il prezzo salirà" nel file SignalMA.mqh ?
//| "Voting" that price will grow. |
//+------------------------------------------------------------------+
int CSignalMA::LongCondition(void)
{
int result=0;
int idx =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator
if(IS_PATTERN_USAGE(1) && DiffOpenMA(idx)>0.0 && DiffMA(idx)>0.0)
{
//--- the open price is above the indicator (i.e. there was an intersection), but the indicator is directed upwards
result=m_pattern_1;
//--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
else
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
//--- if the indicator is directed upwards
if(DiffMA(idx)>0.0)
{
if(DiffOpenMA(idx)<0.0)
{
//--- if the model 2 is used
if(IS_PATTERN_USAGE(2))
{
//--- the open price is below the indicator (i.e. there was an intersection)
result=m_pattern_2;
//--- suggest to enter the market at the "roll back"
m_base_price=m_symbol.NormalizePrice(MA(idx));
}
}
else
{
//--- if the model 3 is used and the open price is above the indicator
if(IS_PATTERN_USAGE(3) && DiffLowMA(idx)<0.0)
{
//--- the low price is below the indicator
result=m_pattern_3;
//--- consider that this is a formed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
}
}
//--- return the result
return(result);
}
Cosa succede se sostituisci questo con il codice del tuo modulo, funzionerà correttamente. Il fatto è che il contenuto è leggermente diverso dal tuo. C'è più codice qui... hmm.
Ho capito che questa è la sezione che è responsabile dell'apertura di una posizione se "il prezzo salirà" nel file SignalMA.mqh ?
//| "Voting" that price will grow. |
//+------------------------------------------------------------------+
int CSignalMA::LongCondition(void)
{
int result=0;
int idx =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed bar
if(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicator
if(IS_PATTERN_USAGE(1) && DiffOpenMA(idx)>0.0 && DiffMA(idx)>0.0)
{
//--- the open price is above the indicator (i.e. there was an intersection), but the indicator is directed upwards
result=m_pattern_1;
//--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
else
{
//--- the close price is above the indicator (the indicator has no objections to buying)
if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
//--- if the indicator is directed upwards
if(DiffMA(idx)>0.0)
{
if(DiffOpenMA(idx)<0.0)
{
//--- if the model 2 is used
if(IS_PATTERN_USAGE(2))
{
//--- the open price is below the indicator (i.e. there was an intersection)
result=m_pattern_2;
//--- suggest to enter the market at the "roll back"
m_base_price=m_symbol.NormalizePrice(MA(idx));
}
}
else
{
//--- if the model 3 is used and the open price is above the indicator
if(IS_PATTERN_USAGE(3) && DiffLowMA(idx)<0.0)
{
//--- the low price is below the indicator
result=m_pattern_3;
//--- consider that this is a formed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
}
}
//--- return the result
return(result);
}
Cosa succede se sostituisci questo con il codice del tuo modulo, funzionerà correttamente. Il fatto è che il contenuto è leggermente diverso dal tuo. C'è più codice qui... hmm.
Se prendi il mio codice e lo incolli qui, non funzionerà.
Se prendi il mio codice e lo incolli qui, non funzionerà.
Se prendi il mio codice e lo incolli qui, non funzionerà.
Vladimir, dove dobbiamo incollare l'inverso per farlo funzionare?
È chiaro che dovrete creare una copia del file e cambiare il nome di questo inlude.
Se volete cambiare i segnali per invertirli nel modulo di segnale standard:
//+------------------------------------------------------------------+
//| Description of the class |
//| Title=*** |
//| Type=SignalAdvanced |
//| Name=Moving Average |
Se volete cambiare i segnali in modo da invertirli nel modulo di segnale standard:
//+------------------------------------------------------------------+
//| Description of the class |
//| Title=*** |
//| Type=SignalAdvanced |
//| Name=Moving Average |
Vladimir, grazie, sei stato molto utile. Ora la domanda rimane come fare gli ordini Take Profit e Stop Loss che l'EA piazza. Come faccio a farli limitare?