5 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
6 //+------------------------------------------------------------------+
\r
8 //| Copyright © 2011, Zarko Asenov |
\r
10 //+------------------------------------------------------------------+
\r
11 #property copyright "Copyright © 2011, Zarko Asenov"
\r
14 /* General settings */
\r
15 extern int Slippage = 3;
\r
16 extern double Lot_Size = 0.12;
\r
17 extern int Magic_Number = 9876543210;
\r
18 extern bool Debug_Print = true;
\r
21 /* Stochastic oscillator */
\r
22 extern int Stoch_K = 6;
\r
23 extern int Stoch_D = 4;
\r
24 extern int Stoch_Slow = 3;
\r
27 extern int MAPeriod = 10;
\r
28 extern int MAGainLimit = 10;
\r
29 extern double DeltaCoef = 1.5;
\r
30 extern double MA_Floor = 0.0015;
\r
32 /* Some grid safety */
\r
33 extern double Grid_Size_Pips = 0.00030;
\r
34 extern int Num_stops = 2;
\r
38 int sell_pos_id = 0;
\r
40 double tick_value = 0;
\r
41 double buy_ceiling_price = 0.0;
\r
44 extern string Orders_Label = "Scalper Zed";
\r
46 /* Stochastic oscillator */
\r
47 extern int Stoch_K = 5;
\r
48 extern int Stoch_D = 5;
\r
49 extern int Stoch_Slow = 3;
\r
50 extern int Stoch_Period = PERIOD_H4;
\r
53 extern int ATR_Fast = 7;
\r
54 extern int ATR_Slow = 39;
\r
55 extern double ATR_Ratio_Floor = 0.75;
\r
56 extern int ATR_Period = PERIOD_H1;
\r
58 /* Some grid safety */
\r
59 extern double Grid_Size_Pips = 0.00032;
\r
60 extern int Num_stops = 2;
\r
61 extern bool Trade_Fridays = false;
\r
64 int deletes_count = 0;
\r
65 int pending_deletes[32];
\r
66 datetime last_go_buy = 0;
\r
67 datetime last_go_sell = 0;
\r
68 double buy_ceiling_price = 0.0;
\r
69 double sell_ceiling_price = 0.0;
\r
70 double spread = 0.0;
\r
71 double stop_level = 0.0;
\r
72 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
75 calc_profit(int magic_number, int op)
\r
77 double presult = 0.0;
\r
79 for (int i = 0; i < OrdersTotal(); i++) {
\r
80 OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
\r
82 if (OrderSymbol() != Symbol() || OrderMagicNumber() != magic_number || OrderType() != op) continue;
\r
84 presult += OrderProfit();
\r
94 return (calc_profit(Magic_Number, OP_BUY));
\r
100 return (calc_profit(Magic_Number, OP_SELL));
\r
104 bool move_orders_stoploss(double price, int op)
\r
106 bool result = true;
\r
107 for (int i = 0; i < OrdersTotal(); i++) {
\r
108 OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
\r
110 if (OrderSymbol() != Symbol() || OrderMagicNumber() != Magic_Number || OrderType() != op) continue;
\r
112 double take_profit = OrderTakeProfit();
\r
114 if (take_profit < price) take_profit = price + Grid_Size_Pips * 2;
\r
116 bool rc = OrderModify(OrderTicket(), OrderOpenPrice(), price, take_profit, OrderExpiration(), Blue);
\r
117 result = rc && result;
\r
118 if (rc == false && Debug_Print == true) {
\r
119 Print("Failed modyfying order "+OrderTicket()+" stop loss to "+price);
\r
126 bool move_buys_stoploss(double price)
\r
128 return ( move_orders_stoploss(price, OP_BUY) );
\r
131 get_periods_time(datetime order_time)
\r
133 double time_diff = TimeCurrent() - order_time;
\r
134 return ( MathFloor( order_time / ( 60 * Period() ) ) );
\r
138 get_high_price(datetime order_time)
\r
140 int time_pos = get_periods_time(order_time);
\r
141 return (High[time_pos]);
\r
145 get_low_price(datetime order_time)
\r
147 int time_pos = get_periods_time(order_time);
\r
148 return (Low[time_pos]);
\r
152 get_order_color(int op)
\r
170 if (Debug_Print) Print("Unknown Order Type "+op);
\r
176 move_orders_stoploss(
\r
181 bool result = true;
\r
184 order_color = get_order_color(op);
\r
186 for (int i = 0; i < OrdersTotal(); i++) {
\r
188 OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
\r
190 if (OrderSymbol() != Symbol() ||
\r
191 OrderMagicNumber() != Magic_Number ||
\r
192 OrderType() != op ||
\r
193 OrderOpenTime() < from ||
\r
194 OrderOpenTime() > to)
\r
203 price = get_low_price( OrderOpenTime() );
\r
209 price = get_high_price( OrderOpenTime() );
\r
213 if (Debug_Print) Print("Uknown order type " + op);
\r
218 bool rc = OrderModify(OrderTicket(), OrderOpenPrice(), price, OrderTakeProfit(), OrderExpiration(), order_color);
\r
219 result = rc && result;
\r
222 if (rc == true) continue;
\r
224 if (Debug_Print == true)
\r
225 Print("Failed modyfying order "+OrderTicket()+" stop loss to "+price);
\r
230 // order should be killed by end of next period no matter what
\r
231 if (OrderOpenTime() + Period() * 60 < Time[0] )
\r
232 rc = OrderClose( OrderTicket(), OrderLots(), OrderClosePrice(), Slippage, order_color);
\r
233 result = result && rc;
\r
234 if (Debug_Print == true && rc == false)
\r
235 Print("Closing order " + OrderTicket() + " failed. Check your shit my friend.");
\r
242 OrderDelete( OrderTicket() );
\r
246 if (Debug_Print) Print("Uknown order type " + op);
\r
255 bool move_prev_buys_stoploss()
\r
258 rc = rc && move_orders_stoploss(OP_BUY, 0, Time[0]);
\r
259 rc = rc && move_orders_stoploss(OP_BUYSTOP, 0, Time[0] );
\r
260 rc = rc && move_orders_stoploss(OP_BUYLIMIT, 0, Time[0] );
\r
265 bool move_prev_sells_stoploss()
\r
268 rc = rc && move_orders_stoploss(OP_SELL, 0, Time[0]);
\r
269 rc = rc && move_orders_stoploss(OP_SELLSTOP, 0, Time[0]);
\r
270 rc = rc && move_orders_stoploss(OP_SELLLIMIT, 0, Time[0]);
\r
273 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
279 bool result = true;
\r
280 for (int i = 0; i < OrdersTotal(); i++) {
\r
281 OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
\r
283 if (OrderSymbol() != Symbol() || OrderMagicNumber() != Magic_Number || OrderType() != op) continue;
\r
285 bool rc = OrderDelete(OrderTicket());
\r
286 result = rc && result;
\r
287 if (rc == false && Debug_Print == true) {
\r
288 Print("Failed deleting order " + OrderTicket() + " type " + op);
\r
297 delete_all_buy_stops()
\r
299 delete_all_pending_buys()
\r
300 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
302 return ( delete_all(OP_BUYSTOP) );
\r
307 place_buy(double lot_size)
\r
311 delete_all_pending_sells()
\r
313 return ( delete_all(OP_SELLSTOP) );
\r
321 for (int i = 0; i < deletes_count; i++) {
\r
322 bool rc = OrderSelect(i, SELECT_BY_TICKET, MODE_TRADES);
\r
324 Print("Select of order " + pending_deletes[i] + " failed.");
\r
328 rc = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Slippage, Khaki);
\r
329 if (rc == false) Print("Uh-oh delete order " + OrderTicket() + " failed. Please check this out manually!");
\r
337 place_buy(double lot_size, double take_profit, double stop_loss)
\r
338 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
340 if (lot_size == 0.0 ) {
\r
341 if (Debug_Print) Print("Scalping disabled!");
\r
346 double ask = MarketInfo(Symbol(), MODE_ASK);
\r
348 if (Debug_Print) Print("Placing scalp buy order at " + ask);
\r
350 int ticketlong = OrderSend(
\r
354 NormalizeDouble(ask, digits),
\r
359 if (Debug_Print) Print("Placing scalp buy order at " + Ask);
\r
361 int ticket_num = OrderSend(
\r
369 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
375 if (Debug_Print) {
\r
377 if (ticketlong < 0) {
\r
378 Print("Whaa long OrderSend failed with error #", GetLastError() );
\r
381 Print("Buy order placed with ticket " + ticketlong + " at " + ask);
\r
385 return (ticketlong);
\r
389 place_buy_stop(double lot_size, double price)
\r
391 if (ticket_num < 0) {
\r
392 Print("Whaa long order failed with error " + GetLastError() );
\r
395 Print("Buy order placed with ticket " + ticket_num + " at " + Ask);
\r
399 return (ticket_num);
\r
403 place_sell(double lot_size, double take_profit, double stop_loss)
\r
404 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
406 if (lot_size == 0.0 ) {
\r
407 if (Debug_Print) Print("Scalping disabled!");
\r
412 if (Debug_Print) Print("Placing scalp buy stop order at " + price);
\r
414 int ticketlong = OrderSend(
\r
418 NormalizeDouble(price, Digits),
\r
421 NormalizeDouble(buy_ceiling_price, Digits),
\r
427 if (Debug_Print) {
\r
428 if (ticketlong < 0) {
\r
429 Print("Whaa OrderSend OP_BUYSTOP, failed with error #" + GetLastError() +
\r
430 " current ASK price for " + Symbol() + " is " + Ask);
\r
433 Print("Buy stop order placed with ticket " + ticketlong + " at " + price);
\r
437 return (ticketlong);
\r
441 place_sell(double lot_size)
\r
443 if (Debug_Print) Print("Placing scalp sell order at " + Bid);
\r
445 int ticket_num = OrderSend(
\r
458 if (Debug_Print) {
\r
459 if (ticket_num < 0) {
\r
460 Print("Whaa short order failed with error " + GetLastError() );
\r
463 Print("Short order placed with ticket " + ticket_num + " at " + Bid);
\r
467 return (ticket_num);
\r
471 place_pending_buy(double lot_size, double price, double take_profit)
\r
472 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
474 if (lot_size == 0.0 ) {
\r
475 if (Debug_Print) Print("Scalping disabled!");
\r
480 double bid = MarketInfo(Symbol(), MODE_BID);
\r
482 if (Debug_Print) Print("Placing scalp sell order at " + bid);
\r
484 int ticketshort = OrderSend(
\r
488 NormalizeDouble(bid, digits),
\r
496 if (Debug_Print) {
\r
497 if (ticketshort < 0) {
\r
498 Print("Whaa short OrderSend failed with error #", GetLastError() );
\r
501 Print("Sell order placed with ticket " + ticketshort + " at " + bid);
\r
505 return (ticketshort);
\r
507 price = NormalizeDouble(price, Digits);
\r
509 if (Debug_Print) Print("Placing pending buy order at " + price);
\r
512 int ticket_num = 0;
\r
513 double stop_loss = 0.0;
\r
515 if (price < Ask) op = OP_BUYLIMIT;
\r
516 else if (price > Ask) op = OP_BUYSTOP;
\r
517 else ticket_num = place_buy(lot_size, take_profit, 0.0);
\r
519 color order_color = get_order_color(OP_BUY);
\r
520 datetime expire_time = Time[0] + Period() * 60;
\r
522 if (ticket_num == 0)
\r
523 ticket_num = OrderSend(
\r
536 if (Debug_Print) {
\r
537 if (ticket_num < 0) {
\r
538 Print("Whaa pending order failed with error #" + GetLastError() +
\r
539 " current ask for " + Symbol() + " is " + Ask);
\r
542 Print("Pending buy order placed with ticket " + ticket_num + " at " + price);
\r
546 return (ticket_num);
\r
550 place_pending_sell(double lot_size, double price, double take_profit)
\r
552 if (lot_size == 0.0 ) {
\r
553 if (Debug_Print) Print("Scalping disabled!");
\r
557 price = NormalizeDouble(price, Digits);
\r
559 if (Debug_Print) Print("Placing pending sell order at " + price);
\r
562 int ticket_num = 0;
\r
563 double stop_loss = 0.0;
\r
565 if (price > Bid) op = OP_SELLLIMIT;
\r
566 else if (price < Bid) op = OP_SELLSTOP;
\r
567 else ticket_num = place_sell(lot_size, take_profit, 0.0);
\r
569 color order_color = get_order_color(OP_SELL);
\r
570 datetime expire_time = Time[0] + Period() * 60;
\r
572 if (ticket_num == 0)
\r
573 ticket_num = OrderSend(
\r
586 if (Debug_Print) {
\r
587 if (ticket_num < 0) {
\r
588 Print("Whaa pending order failed with error #" + GetLastError() +
\r
589 " current bid for " + Symbol() + " is " + Bid);
\r
592 Print("Pending sell order placed with ticket " + ticket_num + " at " + price);
\r
596 return (ticket_num);
\r
597 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
601 close_all(int magic_number, int op)
\r
605 for (int i = 0; i < OrdersTotal(); i++) {
\r
607 OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
\r
609 if (OrderSymbol() != Symbol() ||
\r
610 OrderMagicNumber() != magic_number ||
\r
611 OrderType() != op) continue;
\r
613 int ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Slippage, Gray);
\r
616 Print("Close order failed with error #", GetLastError() );
\r
625 bool force_close_sells = false;
\r
626 bool force_close_buys = false;
\r
631 bool rc = close_all(Magic_Number, OP_SELL);
\r
634 force_close_sells = false;
\r
638 force_close_sells = true;
\r
642 force_close_sells = true;
\r
643 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
650 bool rc = close_all(Magic_Number, OP_BUY);
\r
652 force_close_buys = false;
\r
654 force_close_buys = true;
\r
659 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
662 //+------------------------------------------------------------------+
\r
663 //| expert initialization function |
\r
664 //+------------------------------------------------------------------+
\r
668 tick_value = MarketInfo(Symbol(), MODE_TICKVALUE);
\r
669 digits = MarketInfo(Symbol(), MODE_DIGITS);
\r
674 buy_ceiling_price = 0.0;
\r
675 sell_ceiling_price = 0.0;
\r
676 spread = MarketInfo(Symbol(), MODE_SPREAD) * Point;
\r
677 stop_level = MarketInfo(Symbol(), MODE_STOPLEVEL) * Point;
\r
678 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
683 //+------------------------------------------------------------------+
\r
684 //| expert deinitialization function |
\r
685 //+------------------------------------------------------------------+
\r
693 bool end_is_neigh()
\r
695 if (TimeCurrent() - Time[0] < Period() * 60.0 * 0.9) return (false);
\r
696 else return (true);
\r
702 if (buy_ceiling_price != 0.0) return (false);
\r
704 if (end_is_neigh() == false) return (false);
\r
706 double cur_ma_diff = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 20, 50, 3, 0, 0);
\r
707 if (cur_ma_diff <= 0.0) return (false);
\r
709 double cur_ma_delta_long = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 120, 50, 3, 1, 0);
\r
710 double prev_ma_delta_long = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 120, 50, 3, 1, 0);
\r
711 if (cur_ma_delta_long < prev_ma_delta_long || cur_ma_delta_long <= 0.0) return (false);
\r
713 double cur_ma_delta = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 20, 50, 3, 1, 0);
\r
714 double prev_ma_delta = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 20, 50, 3, 1, 1);
\r
715 if (cur_ma_delta < prev_ma_delta || cur_ma_delta <= 0.0) return (false);
\r
720 if (TimeCurrent() - Time[0] < Period() * 60.0 * 0.8) return (false);
\r
721 else return (true);
\r
727 return ( (High[0] + Low[0]) / 2.0 );
\r
733 return (DayOfWeek() == 5);
\r
740 double atr_ratio = iATR(Symbol(), ATR_Period, ATR_Fast, 0) / iATR(Symbol(), ATR_Period, ATR_Slow, 0);
\r
742 if (atr_ratio < ATR_Ratio_Floor) return (false);
\r
744 double atr_prev_ratio = iATR(Symbol(), ATR_Period, ATR_Fast, 0) / iATR(Symbol(), ATR_Period, ATR_Slow, 0);
\r
746 if (atr_prev_ratio < ATR_Ratio_Floor) return (false);
\r
748 if (atr_ratio < atr_prev_ratio) return (false);
\r
754 stoch_buy(int period)
\r
756 double stoch_k = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 0, 0);
\r
757 if (stoch_k > 85.0 || stoch_k < 45.0) return (false);
\r
759 // make sure stoch is going up
\r
760 double prev_stoch_k = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 0, 1);
\r
761 if (stoch_k <= prev_stoch_k) return (false);
\r
763 // were not in a down trend
\r
764 double stoch_d = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 1, 0);
\r
765 if (stoch_d >= stoch_k) return (false);
\r
767 double prev_stoch_d = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 1, 0);
\r
768 if (prev_stoch_k - prev_stoch_d > stoch_k - stoch_d) return (false);
\r
774 stoch_sell(int period)
\r
776 double stoch_k = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 0, 0);
\r
777 if (stoch_k > 65.0 || stoch_k < 15.0) return (false);
\r
779 // make sure stoch is going down
\r
780 double prev_stoch_k = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 0, 1);
\r
781 if (stoch_k >= prev_stoch_k) return (false);
\r
783 // were in a down trend
\r
784 double stoch_d = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 1, 0);
\r
785 if (stoch_d <= stoch_k) return (false);
\r
787 double prev_stoch_d = iStochastic(Symbol(), period, Stoch_K, Stoch_D, Stoch_Slow, MODE_EMA, 0, 1, 0);
\r
788 if (prev_stoch_k - prev_stoch_d < stoch_k - stoch_d) return (false);
\r
796 if (end_is_neigh() == false) return (false);
\r
797 if (Trade_Fridays == false && is_friday() == true) return (false);
\r
799 if (buy_ceiling_price != 0.0) return (false);
\r
801 double mid_price = get_mid_price();
\r
803 if (Ask + Grid_Size_Pips + stop_level > mid_price) return (false);
\r
805 if (atr_go() == false) return (false);
\r
807 if (stoch_buy(Stoch_Period) == false) return (false);
\r
808 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9
817 if (force_close_buys == true) return (true);
\r
819 if (buy_ceiling_price == 0.0) return (false);
\r
821 double cur_ma_delta_long = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 120, 50, 3, 1, 0);
\r
822 if (cur_ma_delta_long <= 0.0) return (true);
\r
824 double cur_ma_diff_long = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 120, 50, 3, 0, 0);
\r
825 if (end_is_neigh() == false && (cur_ma_delta_long > 0.0 || cur_ma_diff_long > 0.0)) return (false);
\r
827 double cur_ma_delta = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 20, 50, 3, 1, 0);
\r
828 double prev_ma_delta = iCustom(Symbol(), Period(), "Ehlers ZeroLag MA Osc", 20, 50, 3, 1, 1);
\r
829 if (cur_ma_delta < prev_ma_delta && cur_ma_delta < 0.0) return (true);
\r
834 //+------------------------------------------------------------------+
\r
835 //| expert start function |
\r
836 //+------------------------------------------------------------------+
\r
839 if (go_buy() == true) {
\r
840 buy_ceiling_price = Ask;
\r
841 if (Debug_Print) Print("New buy ceiling is "+buy_ceiling_price);
\r
842 for (int i = 1; i < Num_stops + 1; i++) {
\r
843 place_buy_stop(Lot_Size, buy_ceiling_price - i * Grid_Size_Pips);
\r
847 if (buy_ceiling_price != 0.0 && Ask > buy_ceiling_price + Grid_Size_Pips) {
\r
848 move_buys_stoploss( Grid_Size_Pips * MathFloor(Ask / Grid_Size_Pips) - Grid_Size_Pips );
\r
851 if (do_close_buys() == true) {
\r
852 if (Debug_Print) Print("Closing everything.");
\r
853 buy_ceiling_price = 0.0;
\r
855 delete_all_buy_stops();
\r
860 //+------------------------------------------------------------------+
864 if (end_is_neigh() == false) return (false);
\r
865 if (Trade_Fridays == false && is_friday() == true) return (false);
\r
867 if (sell_ceiling_price != 0.0) return (false);
\r
869 double mid_price = get_mid_price();
\r
871 if (Bid - Grid_Size_Pips - stop_level < mid_price) return (false);
\r
873 if (stoch_sell(Stoch_Period) == false) return (false);
\r
875 if (atr_go() == false) return (false);
\r
881 place_buys(double start_price)
\r
885 for (int i = 1; i < Num_stops + 1; i++) {
\r
886 rc = rc && place_pending_buy(Lot_Size, start_price - i * Grid_Size_Pips, start_price - spread);
\r
893 place_sells(double start_price)
\r
897 for (int i = 1; i < Num_stops + 1; i++) {
\r
898 rc = rc && place_pending_sell(Lot_Size, start_price + i * Grid_Size_Pips, start_price + spread);
\r
904 //+------------------------------------------------------------------+
\r
905 //| expert start function |
\r
906 //+------------------------------------------------------------------+
\r
909 spread = MarketInfo(Symbol(), MODE_SPREAD) * Point;
\r
911 if (last_go_buy == 0 && go_buy() == true) {
\r
912 buy_ceiling_price = get_mid_price();
\r
913 if (Debug_Print) Print("New buy ceiling is " + buy_ceiling_price);
\r
914 last_go_buy = TimeCurrent();
\r
915 } else if (last_go_sell == 0 && go_sell() == true) {
\r
916 sell_ceiling_price = get_mid_price();
\r
917 if (Debug_Print) Print("New sell ceiling is " + sell_ceiling_price);
\r
918 last_go_sell = TimeCurrent();
\r
921 if (buy_ceiling_price != 0.0) {
\r
922 place_buys(buy_ceiling_price);
\r
923 buy_ceiling_price = 0.0;
\r
924 } else if (sell_ceiling_price != 0.0) {
\r
925 place_sells(sell_ceiling_price);
\r
926 sell_ceiling_price = 0.0;
\r
929 if (last_go_buy != 0 && TimeCurrent() > last_go_buy + Period() * 60) {
\r
930 if (move_prev_buys_stoploss() == true)
\r
933 last_go_buy += 5 * 60;
\r
934 } else if (last_go_sell != 0 && TimeCurrent() > last_go_sell + Period() * 60) {
\r
935 if (move_prev_sells_stoploss() == true)
\r
938 last_go_sell += 5 * 60;
\r
943 "Buy ceiling: "+buy_ceiling_price+"\n"+
\r
944 "Last go buy: "+last_go_buy+"\n"+
\r
945 "Spread: "+spread+"\n"+
\r
946 "Debug verbosity is on.");
\r
950 //+------------------------------------------------------------------+
951 >>>>>>> d1f8eca3054a866379156d71012f6feb4bddbde9