Coding help - page 459 1...452453454455456457458459460461462463464465466...792 New comment Mladen Rakic 2015.04.15 08:30 #4581 Unca:Then it should take the values from the last desired amount of bars anyway - even 100 bars before. It means it would show the same value (for down bars) for last 100 bars. You mean a sort of "inheriting" the value? Unca 2015.04.15 10:00 #4582 Sometimes one picture is worth 1000 words - check the image attached. Hopefully it will help to understand. Files: picture.png 27 kb Mladen Rakic 2015.04.15 12:08 #4583 Unca:Sometimes one picture is worth 1000 words - check the image attached. Hopefully it will help to understand. Try out this version then : gsv-v1-1.mq4 Files: gsv.gif 66 kb gsv-v1-1.mq4 4 kb Unca 2015.04.15 15:38 #4584 Seems to be working well. Thank you very much mladen! Mladen Rakic 2015.04.15 21:10 #4585 Unca:Seems to be working well. Thank you very much mladen! Good Happy trading Hock 2015.04.15 23:33 #4586 Hi, all. I'm meet some problem in this coding. How can i add profitsize & stopsize in the coding? Thanks. int start() { string Ls_unused_4; int ticket_16; int error_20; int is_closed_24; double price_28; int cmd_36; int Li_0 = WindowHandle(Symbol(), Period()); string Lsa_12[1] = {""}; GetWindowTextA(Li_0, Lsa_12[0], 20); if (Lsa_12[0] == "B") { SetWindowTextA(Li_0, "0"); if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) { ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 0, 0, "expert comment", 255, 0, CLR_NONE); if (ticket_16 < 1) { error_20 = GetLastError(); return (error_20); } OrderPrint(); OP_BUY How to code? what Wrong in this Mladen Rakic 2015.04.16 06:52 #4587 hock87:Hi, all. I'm meet some problem in this coding. How can i add profitsize & stopsize in the coding? Thanks. int start() { string Ls_unused_4; int ticket_16; int error_20; int is_closed_24; double price_28; int cmd_36; int Li_0 = WindowHandle(Symbol(), Period()); string Lsa_12[1] = {""}; GetWindowTextA(Li_0, Lsa_12[0], 20); if (Lsa_12[0] == "B") { SetWindowTextA(Li_0, "0"); if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) { ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 0, 0, "expert comment", 255, 0, CLR_NONE); if (ticket_16 < 1) { error_20 = GetLastError(); return (error_20); } OrderPrint(); You should add the stop loss and take profit after the "3." in the order send Hock 2015.04.16 10:57 #4588 mladen:You should add the stop loss and take profit after the "3." in the order send Thanks. "3" is what mean? "3, 0, 0" First 0 is what mean? and second 0 is what mean? if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) { ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 10, 10, "expert comment", 255, 0, CLR_NONE); Mladen Rakic 2015.04.16 11:14 #4589 hock87:Thanks. "3" is what mean? "3, 0, 0" First 0 is what mean? and second 0 is what mean? if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) { ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 10, 10, "expert comment", 255, 0, CLR_NONE); 3 -> is the maximum slippage first 0 -> is the stop loss (you have to fill it with the stop loss price you wish for the order) second 0 -> is the take profit (you have to fill it with the take profit price you wish for the order) _________________ You can not place 10, 10 there The stop loss must be the order open price +- stop loss in pips (points) The same rule is valid for take profit - order open price +- take profit in pips (points) Pending orders and STOP Experts: gpfTCPivotStop Scripts: Send Pending order spacejockey 2015.04.16 12:36 #4590 Hi mladen if you can make this indy to new fomart jf_tradingtimes.mq4 JF_TradingTimes.mq4 I find this indy its code have many problem,it is very CPU intensive,if you can fix it. thx a lot. Files: jf_tradingtimes.mq4 11 kb 1...452453454455456457458459460461462463464465466...792 New comment
Then it should take the values from the last desired amount of bars anyway - even 100 bars before. It means it would show the same value (for down bars) for last 100 bars.
You mean a sort of "inheriting" the value?
Sometimes one picture is worth 1000 words - check the image attached. Hopefully it will help to understand.
Sometimes one picture is worth 1000 words - check the image attached. Hopefully it will help to understand.
Try out this version then : gsv-v1-1.mq4
Seems to be working well. Thank you very much mladen!
Seems to be working well. Thank you very much mladen!
Good
Happy trading
Hi, all.
I'm meet some problem in this coding.
How can i add profitsize & stopsize in the coding?
Thanks.
int start() {
string Ls_unused_4;
int ticket_16;
int error_20;
int is_closed_24;
double price_28;
int cmd_36;
int Li_0 = WindowHandle(Symbol(), Period());
string Lsa_12[1] = {""};
GetWindowTextA(Li_0, Lsa_12[0], 20);
if (Lsa_12[0] == "B") {
SetWindowTextA(Li_0, "0");
if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) {
ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 0, 0, "expert comment", 255, 0, CLR_NONE);
if (ticket_16 < 1) {
error_20 = GetLastError();
return (error_20);
}
OrderPrint();
Hi, all.
I'm meet some problem in this coding.
How can i add profitsize & stopsize in the coding?
Thanks.
int start() {
string Ls_unused_4;
int ticket_16;
int error_20;
int is_closed_24;
double price_28;
int cmd_36;
int Li_0 = WindowHandle(Symbol(), Period());
string Lsa_12[1] = {""};
GetWindowTextA(Li_0, Lsa_12[0], 20);
if (Lsa_12[0] == "B") {
SetWindowTextA(Li_0, "0");
if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) {
ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 0, 0, "expert comment", 255, 0, CLR_NONE);
if (ticket_16 < 1) {
error_20 = GetLastError();
return (error_20);
}
OrderPrint();You should add the stop loss and take profit after the "3." in the order send
You should add the stop loss and take profit after the "3." in the order send
Thanks.
"3" is what mean?
"3, 0, 0"
First 0 is what mean?
and second 0 is what mean?
if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) {
ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 10, 10, "expert comment", 255, 0, CLR_NONE);
Thanks.
"3" is what mean?
"3, 0, 0"
First 0 is what mean?
and second 0 is what mean?
if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == FALSE) {
ticket_16 = OrderSend(Symbol(), OP_BUY, 1.0, Ask, 3, 10, 10, "expert comment", 255, 0, CLR_NONE);3 -> is the maximum slippage
first 0 -> is the stop loss (you have to fill it with the stop loss price you wish for the order)
second 0 -> is the take profit (you have to fill it with the take profit price you wish for the order)
_________________
You can not place 10, 10 there
The stop loss must be the order open price +- stop loss in pips (points)
The same rule is valid for take profit - order open price +- take profit in pips (points)
Hi mladen
if you can make this indy to new fomart
jf_tradingtimes.mq4
JF_TradingTimes.mq4
I find this indy its code have many problem,it is very CPU intensive,if you can fix it.
thx a lot.