Cześć wszystkim,
Próbuję kodować EA, który obsługuje progresję d'alemberta (dla wszystkich, którzy nie znają progresji d'alembert:
http://www.bettingexpert.com/casino/...lembert-system)
Planujemy zacząć od 0,01 lota i SL 13 pipsówTP 14 pipsów.
Za każdym razem, gdy transakcja zbliża się do y, nowy handel otwiera się natychmiast z dodatkowymi 0,01 lotami, a po wygranej handlu następuje natychmiastowy handel z 0,01 lotami mniejszymi niż loteria zanim dojedziemy do 0,01 lota.
Przykład:
1. handlu 0.01 a partii
2. handlować 0,02 lotami
3. handlu 0,03 lot wiele
4. handlu 0,04 lot y
5. zamień 0,05 lota
6. handel 0,04 losów wygranych
7. handel 0,03 losów
8. handel 0.02 lot
9. handluj 0,01 lotem
Oto mój pierwszy próbny kod, ale nie działa on w testerze egii. :-(
Kto może pomóc?
Wstawiony kod/ --------------------------------------------- --------------------- /| A4.mq4 |/| Prawa autorskie © 2010, MetaQuotes Software Corp./| http://www.metaquotes.net |/ ----------------------------------------------- ------------------- #property copyright Copyright © 2010, MetaQuotes Software Corp. link #property http://www.metaquotes.net/ ---- -------------------------------------------------- ------------ /| zewnętrzne parametry wejściowe |/ ----------------------------------------------- ------------------- extern int MagicNumber_101 = 101000; extern int SL = 13; extern int TP = 14; double dXPoint = 1;/ ----------------------------------------------- ------------------- /| funkcja inicjalizacji eksperta |/ ----------------------------------------------- ------------------- int init () {//----/---- return (0); }/ ---------------------------------------------- -------------------- /| funkcja dezinicjalizacji eksperta |/ ----------------------------------------------- ------------------- int deinit () {//----/---- return (0); }/ ---------------------------------------------- -------------------- /| funkcja startu eksperta |/ ----------------------------------------------- ------------------- int start () {double Lotsize = 0,01; if (OrdersHistoryTotal () gt; = 1) {OrderSelect (OrdersHistoryTotal () - 1, SELECT_BY_POS); Lotsize = OrderLots (); } if (OrderProfit () lt; 0 OrdersHistoryTotal () gt; = 1) {Lotsize = Lotsize 0.01; } if (OrderProfit () gt; 0 OrdersHistoryTotal () gt; = 1 Lotsizegt; = 0.02) {Lotsize = Lotsize - 0,01; } if (OrdersHistoryTotal () lt; 1 min () == 00) {OrderSend (Symbol (), OP_BUY, 0.01, MarketInfo (Symbol (), MODE_ASK), 2, Bid-SL * Punkt, Licytacja TP * Punkt, kup, MagicNumber_101,0, CLR_NONE); } Sleep (120000); if (OrdersTotal () == 0 minuta () == 00) {OrderSelect (OrdersHistoryTotal () - 1, SELECT_BY_POS); if (OrderProfit () gt; 0 OrderType () == OP_BUY) {OrderSend (Symbol (), OP_BUY, 0.01, MarketInfo (Symbol (), MODE_ASK), 2, Bid-SL * Point, Bid TP * Point, kup , MagicNumber_101,0, CLR_NONE); } Sleep (120000); } if (OrdersTotal () == 0 minut () == 00) {if (OrderProfit () gt; 0 OrderType () == OP_SELL) {OrderSend (Symbol (), OP_SELL, 0.01, MarketInfo (Symbol (), MODE_BID ), 2, Ask SL * Point, Ask-TP * Point, sell, MagicNumber_101,0, CLR_NONE); } Sleep (120000); } if (OrdersTotal () == 0 minuta () == 00) {if (OrderProfit () lt; 0 OrderType () == OP_SELL) {OrderSend (Symbol (), OP_BUY, 0.01, MarketInfo (Symbol (), MODE_ASK), 2, Bid-SL * Punkt, Licytacja TP * Punkt, zakup, MagicNumber_101,0, CLR_NONE); } Sleep (120000); } if (OrdersTotal () == 0 minut () == 00) {if (OrderProfit () lt; 0 OrderType () == OP_BUY) {OrderSend (Symbol (), OP_SELL, 0.01, MarketInfo (Symbol (), MODE_BID ), 2, Ask SL * Point, Ask-TP * Point, sell, MagicNumber_101,0, CLR_NONE); } Sleep (120000); } return (0); }
Proszę nie komentować, jak usunąć swoje konto ... blabla
Po prostu dzielenie egii handlowej.
Pozdrowienia.