Rating: Empty Star Empty Star Empty Star Empty Star Empty Star
Quick multiple buy
FSShop

Member Since Oct 31, 2011  2 posts ForexSoftwareShop.com (FSShop) Oct 31 2011 at 14:58
Its simple forex MT4 soft for free:

'FSS Quick multiple buy' script will be useful for traders who need to quickly open multiple buy positions in Metatrader trading platform.

Inputs:
OrderCount - determine how much positions must be opened;
StopLoss - initial Stop Loss value;
StopLossStep - Stop Loss will be increased by StopLossStep value for every next order. If Stop Loss must be equal for all orders then input 0 for StopLossStep;
TakeProfit - initial Take Profit value;
TakeProfitStep - Take Profit will be increased by TakeProfitStep value for every next order. If Take Profit must be equal for all orders then input 0 for TakeProfitStep;
Lots - lot size;
ECN - if you are usin ECN broker, then select TRUE. If non-ECN broker, then select FALSE. If you are not sure, then leave FALSE.
Comm - comment.
-------------------------------------------------------------------------------

//+------------------------------------------------------------------+
//| FSS quick multiple buy.mq4 |
//| ForexSoftwareShop |
//| http://www.forexsoftwareshop.com |
//+------------------------------------------------------------------+
#property copyright 'ForexSoftwareShop'
#property link 'http://www.forexsoftwareshop.com'
#property show_inputs

#include <stdlib.mqh>

extern int OrderCount = 3;
extern double StopLoss = 0.005;
extern double StopLossStep = 0;
extern double TakeProfit = 0.002;
extern double TakeProfitStep = 0.003;
extern double Lots = 0.01;
extern bool ECN = FALSE;
extern string Comm = 'FSS_quick_multiple_buy';

//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
  {
//----
   int ticket, cnt, error;
   ticket = 0;
   for(cnt = 0; cnt < OrderCount; cnt++ )
      {
         RefreshRates();
         if (ECN == FALSE) ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, Ask - StopLoss, Ask + TakeProfit, Comm, 123654);
         
         if (ticket == -1 || ECN == TRUE)
            {
               error = GetLastError();
               if(error == 130/* INVALID_STOPS */ || ECN == TRUE)
                  {
                     ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, 0, Comm, 123654);
                     if(ticket>0)
                        {
                           OrderSelect(ticket, SELECT_BY_TICKET);
                           if(OrderModify(OrderTicket(), OrderOpenPrice(), Ask - StopLoss, Ask + TakeProfit,0) == FALSE) ticket = -1;
                        }
                     if(ticket == -1)
                        {
                           error = GetLastError();
                           Print('Error nr.: ',error,' Error Description: ',ErrorDescription(error));
                        }
                  } else Print('Error nr.: ',error,' Error Description: ',ErrorDescription(error));
            } // ticket == -1
         
         StopLoss = StopLoss + StopLossStep;
         TakeProfit = TakeProfit + TakeProfitStep;
      }
//----
   return(0);
  }
//+------------------------------------------------------------------+

forexsoftwareshop.com
Please login to comment.
Tools Community Reviews Platform Company Support
Economic Calendar Community Brokers Features About FAQ
Forex Broker Spreads Systems Expert Advisors API Blog Help
Streaming Forex News Strategies Signal Providers Translations Twitter Contact Us
Community Outlook Contests VPS Services Mobile Facebook Report A Bug!
Widgets EA Programming        
RSS          

Site Map  |   Terms & Conditions  |   Privacy Policy
©2011 Myfxbook Ltd. All Rights Reserved.
HIGH RISK WARNING: Foreign exchange trading carries a high level of risk that may not be suitable for all investors. Leverage creates additional risk and loss exposure. Before you decide to trade foreign exchange, carefully consider your investment objectives, experience level, and risk tolerance. You could lose some or all of your initial investment; do not invest money that you cannot afford to lose. Educate yourself on the risks associated with foreign exchange trading, and seek advice from an independent financial or tax advisor if you have any questions. Any data and information is provided 'as is' solely for informational purposes, and is not intended for trading purposes or advice.
*GFT is a sponsor of myfxbook.com for advertisement purposes only. GFT does not endorse any other products, services, or companies represented on myfxbook.com. The views of myfxbook.com and all other parties contained therein are not necessarily those of GFT, and GFT makes no warranty as to the accuracy of information provided.