Coding help - page 551

 

ok mladen, I will be very thankful

 

Is there a way to know what slippage will be applied before the order gets executed?

 

ok sir , thank you

 
apprentice coder:
Is there a way to know what slippage will be applied before the order gets executed?

apprentice coder

No, there is no way to know that before the execution of the order

 

I have a question about the "close all in profit function".

Is that any way can make the function when only the position have open more then 1 order only it active?

I have set my profit target ( example 500point ), for each open order .

When have more then 2 position open i want close my profit at small amount ( example $10).

I use it at martingale .

extern double Profit_ = 1000; // Profit in $ to close all open orders

extern double Loss_ = 0; // Loss in $ to close all open orders

[/CODE]

[CODE]if (OrdersTotal()>0 && Profit_>0 && NetProfit()>=Profit_){

CloseAll(0);

Sleep(1000);

if (OrdersTotal()>0) CloseAll(0);

}

if (OrdersTotal()>0 && Loss_>0 && NetProfit()<=-Loss_){

CloseAll(0);

Sleep(1000);

if (OrdersTotal()>0) CloseAll(0);

}

Sorry , i cant post the last part of the code .

Every time i post it i getting error from the forum , dont know why ???

Steven .

 
stevenpun:
I have a question about the "close all in profit function".

Is that any way can make the function when only the position have open more then 1 order only it active?

I have set my profit target ( example 500point ), for each open order .

When have more then 2 position open i want close my profit at small amount ( example $10).

I use it at martingale .

extern double Profit_ = 1000; // Profit in $ to close all open orders

extern double Loss_ = 0; // Loss in $ to close all open orders

[/CODE]

[CODE]if (OrdersTotal()>0 && Profit_>0 && NetProfit()>=Profit_){

CloseAll(0);

Sleep(1000);

if (OrdersTotal()>0) CloseAll(0);

}

if (OrdersTotal()>0 && Loss_>0 && NetProfit()<=-Loss_){

CloseAll(0);

Sleep(1000);

if (OrdersTotal()>0) CloseAll(0);

}

Sorry , i cant post the last part of the code .

Every time i post it i getting error from the forum , dont know why ???

Steven .

Steven

You can change the OrdersTotal()>0 to OrdersTotal()>1 (for example), and then the close all function would be called only if there is 2 or more currently opened orders

_________________

PS: try posting the code using the PHP instead of CODE field - maybe the problem is in the CODE (that has it's limitations)

 
mladen:
apprentice coder No, there is no way to know that before the execution of the order

OK. Thanks!

 
mladen:
Steven

You can change the OrdersTotal()>0 to OrdersTotal()>1 (for example), and then the close all function would be called only if there is 2 or more currently opened orders

_________________

PS: try posting the code using the PHP instead of CODE field - maybe the problem is in the CODE (that has it's limitations)

I have try PHP field and the html field just now , but also cant post it .

And thanks for your advise , i will try it .

 
stevenpun:
I have try PHP field and the html field just now , but also cant post it . And thanks for your advise , i will try it .

Steven

Please let us know if nothing changed regarding your code postings

 

hello,

I have a question how to enable these colorful labels with price at the right side of the chart?

Files:
xkmxkuz.png  106 kb
Reason: