Coding help - page 459

 
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?

 

Sometimes one picture is worth 1000 words - check the image attached. Hopefully it will help to understand.

Files:
picture.png  27 kb
 
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
 

Seems to be working well. Thank you very much mladen!

 
Unca:
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();

 
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

 
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);

 
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)

 

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:
Reason: