Communauté d'expertise - page 11

 
Oui, la convivialité de votre visage est excellente ! :)
 
C'est sérieux, ou tu te moques de moi ? ;)
 
Je vois la description mais pas de pièces jointes. Où puis-je télécharger la bibliothèque ?
 
besoin de s'inscrire....
 
J'avais oublié. Tout s'est arrangé. Merci. On verra.
 
C'est sérieux, ou tu te moques de moi ? ;)

sérieusement, pour les nouveaux arrivants sur le marché, c'est la bonne chose à faire !, soigné, informatif, maintenant il faut passer aux choses sérieuses.
 
Merci. Je me demande toujours quoi faire d'autre...
les suggestions d'amélioration sont acceptées d'emblée =)
 
Je propose de discuter du sujet suivant:<br/ translate="no"> comment est réel le trading sur plusieurs symboles et/ou timeframes au sein d'un Expert Advisor ?

Je suis actuellement assis et je pense - devrais-je poster symbol_lib et le modèle d'Expert Advisor, destiné à cet effet =)
et je pense qu'il n'y a pas un tel besoin... Si je négocie sur différents comptes, je devrai toujours utiliser plusieurs terminaux, et si je négocie sur un seul compte, j'ouvrirai simplement plusieurs fenêtres. Et il y aurait moins de confusion, il semble...

Il sera intéressant d'entendre les opinions et les arguments à leur sujet ;)


Le sujet est intéressant, surtout s'il y a une possibilité de faire du commerce 24 heures sur 24, (dédié ou ADSL et "serveur").
Je ne suis pas un programmeur, mais j'ai mis en œuvre le trading sur plusieurs paires, le thème lui-même, l'indicateur a été pris pour une pure expérimentation, il est clair que les termes du commerce chacun choisira pour lui-même. Le seul problème est que l'EA doit vérifier si les ordres sont là et s'ils sont là pour le symbole testé, désolé pour le jeu de mots, je m'en lasse.


//----------------S'il existe des ordres sur la paire vl-----------------------


int total=OrdersTotal() ;
int n=0 ;
Print ("Total orders==",total) ;
if (total>0)
{for (cnt=0;cnt>total;cnt++)
{OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES) ;
{if(OrderSymbol()==vl)
{n++ ; return(0) ;
}
}
}
}
//Print("NNN==",n," ",vl) ;
Print("STEP==",cnt," ", "Symbol", vl," ", "Orders==",n) ;
//---------------------------------------------

C'est un morceau de code qui ne fonctionne pas, dites-moi, du haut de l'esprit d'un programmeur sérieux, quel est le "bug".
 
Il n'y a pas de "programmeurs sérieux" ici =) La plupart des personnes autodidactes ici )
Oui, nous devrions attribuer un MagicNumber à la commande, et ensuite vérifier après orderselect - if ( OrderMagicNumber() == _MagicNumber ) { puis faire quelque chose avec l'ordre.
Il vous faudra probablement "bricoler" vous-même pour comprendre comment cela fonctionne ;).

Je vais essayer de vous faciliter la vie - la fonction _MagicNumber (ATTENTION : si la paire requise n'est pas dans la liste, la magie sera générée de manière non originale)
.
/////////////////////////////////////////////////////////////////////////////////
/**/ int _MagicNumber( int Expert_Id, string _Symbol, int _Period )
/////////////////////////////////////////////////////////////////////////////////
// Ф-ция генерирует MagicNumber, уникальный для связки Expert_Id - _Symbol - _Period.
// Expert_Id должен быть максимум четырёхзначный (т.е. <= 9999)
// Полученый MagicNumber будет 6-ти или 7-мизначный (в зависимости от Символа) и будет выглядеть так:
// SSPEEEE, где SS - это код символа (от 1 до 71), P - это код периода (от 1 до 8) и EEEE - Expert_Id (от 1 до 9999)
// 
// Таким образом, даже с одинаковым Expert_Id эксперты, работающие на разных Символах/ТФ будут использовать разные MagicNumber.
// Например, при Expert_Id = 1230, _Symbol = GBPUSD и _Period = PERIOD_H1,  MagicNumber будет 1141230
// А этот же эксперт, но на графике с периодом PERIOD_W1 будет иметь MagicNumber = 1181230
// Соответственно, если символ графика будет EURAUD, MagicNumber будет 141230
//
// т.е. Expert_Id есть смысл менять только если два эксперта работают на одном символе и одном ТФ
/////////////////////////////////////////////////////////////////////////////////
{
	int Period_Id = 9;
	switch ( _Period )
	{
		case PERIOD_MN1: Period_Id = 8; break;
		case PERIOD_W1:  Period_Id = 7; break;
		case PERIOD_D1:  Period_Id = 6; break;
		case PERIOD_H4:  Period_Id = 5; break;
		case PERIOD_H1:  Period_Id = 4; break;
		case PERIOD_M15: Period_Id = 3; break;
		case PERIOD_M5:  Period_Id = 2; break;
		case PERIOD_M1:  Period_Id = 1; break;
		default: Print( "trade_lib&info_lib - _MagicNumber( ", Expert_Id, ", ", _Symbol, ", ", _Period, " ) - Invalid Period! Function shall reurn 0!" ); return(0);
	}
	Period_Id *= 10000;
	
	int Symbol_Id = 99;
// forex
	if ( _Symbol == "AUDUSD" ) { Symbol_Id =  1; }
	if ( _Symbol == "CHFJPY" ) { Symbol_Id =  2; }
	if ( _Symbol == "EURAUD" ) { Symbol_Id =  3; }
	if ( _Symbol == "EURCAD" ) { Symbol_Id =  4; }
	if ( _Symbol == "EURCHF" ) { Symbol_Id =  5; }
	if ( _Symbol == "EURGBP" ) { Symbol_Id =  8; }
	if ( _Symbol == "EURJPY" ) { Symbol_Id =  7; }
	if ( _Symbol == "EURUSD" ) { Symbol_Id =  6; }
	if ( _Symbol == "GBPCHF" ) { Symbol_Id =  9; }
	if ( _Symbol == "GBPJPY" ) { Symbol_Id = 10; }
	if ( _Symbol == "GBPUSD" ) { Symbol_Id = 11; }
	if ( _Symbol == "USDCAD" ) { Symbol_Id = 12; }
	if ( _Symbol == "USDCHF" ) { Symbol_Id = 13; }
	if ( _Symbol == "USDJPY" ) { Symbol_Id = 14; }

// stock
	if ( _Symbol == "GOLD"   ) { Symbol_Id = 15; }

//cfd
	if ( _Symbol == "#AA"    ) { Symbol_Id = 16; }
	if ( _Symbol == "#AIG"   ) { Symbol_Id = 17; }
	if ( _Symbol == "#AXP"   ) { Symbol_Id = 18; }
	if ( _Symbol == "#BA"    ) { Symbol_Id = 19; }
	if ( _Symbol == "#C"     ) { Symbol_Id = 20; }
	if ( _Symbol == "#CAT"   ) { Symbol_Id = 21; }
	if ( _Symbol == "#DD"    ) { Symbol_Id = 22; }
	if ( _Symbol == "#DIA"   ) { Symbol_Id = 23; }
	if ( _Symbol == "#DIS"   ) { Symbol_Id = 24; }
	if ( _Symbol == "#EK"    ) { Symbol_Id = 25; }
	if ( _Symbol == "#GE"    ) { Symbol_Id = 26; }
	if ( _Symbol == "#GM"    ) { Symbol_Id = 27; }
	if ( _Symbol == "#HD"    ) { Symbol_Id = 28; }
	if ( _Symbol == "#HON"   ) { Symbol_Id = 29; }
	if ( _Symbol == "#HPQ"   ) { Symbol_Id = 30; }
	if ( _Symbol == "#IBM"   ) { Symbol_Id = 31; }
	if ( _Symbol == "#INTC"  ) { Symbol_Id = 32; }
	if ( _Symbol == "#IP"    ) { Symbol_Id = 33; }
	if ( _Symbol == "#JNJ"   ) { Symbol_Id = 34; }
	if ( _Symbol == "#JPM"   ) { Symbol_Id = 35; }
	if ( _Symbol == "#KO"    ) { Symbol_Id = 36; }
	if ( _Symbol == "#MCD"   ) { Symbol_Id = 37; }
	if ( _Symbol == "#MMM"   ) { Symbol_Id = 38; }
	if ( _Symbol == "#MO"    ) { Symbol_Id = 39; }
	if ( _Symbol == "#MRK"   ) { Symbol_Id = 40; }
	if ( _Symbol == "#MSFT"  ) { Symbol_Id = 41; }
	if ( _Symbol == "#PFE"   ) { Symbol_Id = 42; }
	if ( _Symbol == "#PG"    ) { Symbol_Id = 43; }
	if ( _Symbol == "#QQQ"   ) { Symbol_Id = 44; }
	if ( _Symbol == "#SBC"   ) { Symbol_Id = 45; }
	if ( _Symbol == "#SPY"   ) { Symbol_Id = 46; }
	if ( _Symbol == "#T"     ) { Symbol_Id = 47; }
	if ( _Symbol == "#UTX"   ) { Symbol_Id = 48; }
	if ( _Symbol == "#VZ"    ) { Symbol_Id = 49; }
	if ( _Symbol == "#WMT"   ) { Symbol_Id = 50; }
	if ( _Symbol == "#XOM"   ) { Symbol_Id = 51; }

//futures
	if ( _Symbol == "#CH5"   ) { Symbol_Id = 52; }
	if ( _Symbol == "#CK5"   ) { Symbol_Id = 53; }
	if ( _Symbol == "#CLG5"  ) { Symbol_Id = 54; }
	if ( _Symbol == "#CLH5"  ) { Symbol_Id = 55; }
	if ( _Symbol == "#CLJ5"  ) { Symbol_Id = 56; }
	if ( _Symbol == "#ENQH5" ) { Symbol_Id = 57; }
	if ( _Symbol == "#EPH5"  ) { Symbol_Id = 58; }
	if ( _Symbol == "#GOLDG5") { Symbol_Id = 59; }
	if ( _Symbol == "#GOLDJ5") { Symbol_Id = 60; }
	if ( _Symbol == "#NGH5"  ) { Symbol_Id = 61; }
	if ( _Symbol == "#NGJ5"  ) { Symbol_Id = 62; }
	if ( _Symbol == "#SH5"   ) { Symbol_Id = 63; }
	if ( _Symbol == "#SK5"   ) { Symbol_Id = 64; }
	if ( _Symbol == "#SLVH"  ) { Symbol_Id = 65; }
	if ( _Symbol == "#WH5"   ) { Symbol_Id = 66; }
	if ( _Symbol == "#WK5"   ) { Symbol_Id = 67; }

//index
	if ( _Symbol == "_DJI"   ) { Symbol_Id = 68; }
	if ( _Symbol == "_NQ100" ) { Symbol_Id = 69; }
	if ( _Symbol == "_NQCOMP") { Symbol_Id = 70; }
	if ( _Symbol == "_SP500" ) { Symbol_Id = 71; }

	if ( Symbol_Id == 99 ) { Print( "trade_lib&info_lib - _MagicNumber( ", Expert_Id, ", ", _Symbol, ", ", _Period, " ) - Invalid Symbol! Function shall reurn 0!" ); return(0); }
	Symbol_Id *= 100000;
	
	return(Expert_Id + Period_Id + Symbol_Id);
}
 
[quote]Il n'y a pas de "programmeurs sérieux" ici =) La plupart d'entre eux sont autodidactes.)
[qoute]
Je l'ai eu, merci pour MN, un grand merci pour la bibliothèque, je vais l'essayer.