Alors robot et baser sur Stochastic, le principe de fonctionnement et très simple :
pour le moment j'ai fait la partie Bay (achat)
2 sur le graphe
si P<20 et S<20 et P>S achet a un lot donner
1 sur le graphe
pour fermer il faut (P>80 et S>80 et P<S) ça se la condition de Sell (vante) et Profit >0
Sa marche très bien son perte, mais le robot se déclenche rarement
aaaa le robot et fait avec diagramme pas programmation, sur le site http://strategytune.com/ StrategyTune Visual EA builder
Comment ajouter le Sell
Rendre le robot plut fonctionnel car il rate beaucoup d'occasion.
pour le moment j'ai fait la partie Bay (achat)
2 sur le graphe
si P<20 et S<20 et P>S achet a un lot donner
1 sur le graphe
pour fermer il faut (P>80 et S>80 et P<S) ça se la condition de Sell (vante) et Profit >0
Sa marche très bien son perte, mais le robot se déclenche rarement
aaaa le robot et fait avec diagramme pas programmation, sur le site http://strategytune.com/ StrategyTune Visual EA builder
Code
#define __STRATEGY_MAGIC 2138633110
//Inputs
extern double lots = 0.01;
//Declaration
double _P;
bool _Compare;
double _S;
bool _Compare_2;
bool _Compare_3;
bool _Bay;
bool _open_bay;
bool _Order_Status;
bool _AND;
bool _Close_bay;
double _Order_Data;
bool _Compare_4;
bool _Compare_5;
bool _Compare_6;
bool _Compare_7;
int start(){
//Level 1
_P = iStochastic(Symbol(),0,14,3,3,1,0,0,0);
_S = iStochastic(Symbol(),0,14,3,3,0,0,1,0);
_Order_Status = __isBuy(0);
_Order_Data = __Profit(0);
//Level 2
_Compare = _P < 20;
_Compare_2 = _S < 20;
_Compare_3 = _P > _S;
_Compare_4 = _Order_Data > 0;
_Compare_5 = _P > 80;
_Compare_6 = _S > 80;
_Compare_7 = _P < _S;
//Level 3
_Bay = _Compare && _Compare_2 && _Compare_3;
_AND = _Order_Status && _Compare_4 && _Compare_5 && _Compare_6 && _Compare_7;
//Level 4
if(_Bay && !__isExist(0))_open_bay = OrderSend(Symbol(),0,lots,MarketInfo(Symbol(),MODE_ASK),0,0,0,"",__STRATEGY_MAGIC + 0)>=0;
if(_AND)_Close_bay = OrderClose(__Ticket(0),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID)+MarketInfo(OrderSymbol(),MODE_SPREAD)*MarketInfo(OrderSymbol(),MODE_POINT)*(OrderType()==1),0);
return(0);
}
//Services
bool __selectOrderByMagic(int __magic){for(int __i=0;__i<OrdersTotal();__i++){if(OrderSelect(__i,SELECT_BY_POS,MODE_TRADES)&&OrderMagicNumber()==__STRATEGY_MAGIC+__magic)return(true);}return(false);}
bool __isExist(int __magic){return(__selectOrderByMagic(__magic));}
bool __isBuy(int __magic){if(!__selectOrderByMagic(__magic))return(false);return(OrderType()==OP_BUY || OrderType()==OP_BUYLIMIT || OrderType()==OP_BUYSTOP);}
int __Ticket(int __magic){if(!__selectOrderByMagic(__magic))return(0);return(OrderTicket());}
double __Profit(int __magic){if(!__selectOrderByMagic(__magic))return(0);return(OrderProfit());}
Comment ajouter le Sell
Rendre le robot plut fonctionnel car il rate beaucoup d'occasion.
Modifié le 2013-11-30 18:51:04 par
AliX
: ne pas cacher les liens, les gens doivent savoir où ils vont