how to know what is the minimum of stoploss
so my question is how I shall have a chance to assign variable--"open_time" and "lots" again after I have attached this EA.
Click on the smiley face and amend the input parameters
when I use "ordersend" to open orders as below:
OrderSend(Symbol(),OP_BUY,lots,OrderClosePrice()+100*Point,3,0,0,0,0,0,0);
Sometime MT4 will complain that the stoploss is too little, but I don't know how to know what is the minimum for some pair's stoploss.
OrderSend(Symbol(),OP_BUY,lots,OrderClosePrice()+100*Point,3,0,0,0,0,0,0);when I execute this EA and without any assignment, then the messagebox will come out for complaining that"please set opening time and lots at first", then I click OK button and then i will get the complain again.
- You can NOT use OrderClosePrice() until you do a successful OrderSelect. How do you expect to select the order, when you haven't even sent it yet?
- Of course you get the complaint again. A tick comes in, lots=0, you put up the message. Once you press the OK button you have to call up the EA's parameters to change them BEFORE the next tick or you are right back at the message box. A) Add a time stamp on when you received the OK and stop opening the box to give the human time to do it, or B) have the EA open the parameter box via postMessage.
if (open_time==0||lots==0) { int note=MessageBox("Please set opening time and lots at first!","Alert Message",MB_YESNO|MB_ICONEXCLAMATION); if (note==IDOK) return (0); }
Missing braces
- You can NOT use OrderClosePrice() until you do a successful OrderSelect. How do you expect to select the order, when you haven't even sent it yet?
- Of course you get the complaint again. A tick comes in, lots=0, you put up the message. Once you press the OK button you have to call up the EA's parameters to change them BEFORE the next tick or you are right back at the message box. A) Add a time stamp on when you received the OK and stop opening the box to give the human time to do it, or B) have the EA open the parameter box via postMessage.
-
Missing braces
yes, you are right.
but I can't understand "B) ", shall I get detail code for this?
when I use "ordersend" to open orders as below:
OrderSend(Symbol(),OP_BUY,lots,OrderClosePrice()+100*Point,3,0,0,0,0,0,0);
Sometime MT4 will complain that the stoploss is too little, but I don't know how to know what is the minimum for some pair's stoploss.
another question: about messagebox
when I execute this EA and without any assignment, then the messagebox will come out for complaining that"please set opening time and lots at first", then I click OK button and then i will get the complain again.
so my question is how I shall have a chance to assign variable--"open_time" and "lots" again after I have attached this EA.