Help with these two scripts please.

To add comments, please log in or register
descaboy
78
descaboy  

Hi,


I downloaded these two scripts on a forum, they were supposed to open 3 positions at a time, but when I drag and drop them on my chart they open only one position. Can someone correct that for me please. Also can someone modify those scripts for me so that they can not only open the 3 positions, but also place stop loss and take profit to the opened positions?


Here's the first one, it should open buy position:


//+------------------------------------------------------------------+
//| JMBUYER.mq4 |
//| Copyright © 2008, PRMQuotes Software Corp. |
//| Jedimedic77@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, PRMQuotes Software Corp."

#include <stdlib.mqh>
#include <WinUser32.mqh>

//+----------------------------------------------------------------------+
//| To modify Lotsize of script change value listed here, right now |
//| its set to 1.0 change that value if you desire different lotsize |
//| I have found that it is important to keep the decimal in place, |
//| but really dont know why yet, but fractional lots work too (ex... |
//| 0.1, 0.3, 1.12), you get the picture. |
//| AGAIN DONT FORGET TO SAVE AND COMPILE AFTER MAKING ANY MODIFICATIONS |
//+----------------------------------------------------------------------+
extern double Lots = 5.0;
//+---Don't forget to save and compile after changing the Lotsize--------+

//+------------------------------------------------------------------+
//| Each of the following lines produces an individual order |
//| 3 lines produces 3 orders, to increase or decrease the number |
//| of individual orders either add, or take away identical lines |
//| within the parenthesis. Again dont forget to save and compile |
//| time you modify the code. |
//+------------------------------------------------------------------+
int start()
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"JMBUYER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"JMBUYER",0,0,CLR_NONE);
}
//+------------------------------------------------------------------+


Here's the second one, it should open sell position:


//+------------------------------------------------------------------+
//| JMSELLER.mq4 |
//| Copyright © 2008, PRMQuotes Software Corp. |
//| Jedimedic77@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, PRMQuotes Software Corp."

#include <stdlib.mqh>
#include <WinUser32.mqh>
//+----------------------------------------------------------------------+
//| To modify Lotsize of script change value listed here, right now |
//| its set to 1.0 change that value if you desire different lotsize |
//| I have found that it is important to keep the decimal in place, |
//| but really dont know why yet, but fractional lots work too (ex... |
//| 0.1, 0.3, 1.12), you get the picture. |
//| AGAIN DONT FORGET TO SAVE AND COMPILE AFTER MAKING ANY MODIFICATIONS |
//+----------------------------------------------------------------------+
extern double Lots = 5.0;
//+---Don't forget to save and compile after changing the Lotsize----+

//+------------------------------------------------------------------+
//| Each of the following lines produces an individual order |
//| 3 lines produces 3 orders, to increase or decrease the number |
//| of individual orders either add, or take away identical lines |
//| within the parenthesis. Again dont forget to save and compile |
//| time you modify the code. |
//+------------------------------------------------------------------+
int start()
{
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"JMSELLER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"JMSELLER",0,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"JMSELLER",0,0,CLR_NONE);
}
//+------------------------------------------------------------------+


Thank you for your help!


Regards,

Descaboy

To add comments, please log in or register