I want to close all orders on net profit of all orders. How should I handle the slippage parameter in the ordersclose function?
Can I just close at the market?
Yes, if the market is moving slowly enough for the price to be at the current Bid/Ask to execute your trade. Read up on OrderClosePrice() you can use it to close a Buy or Sell at the current market price, bear in mind you first need to OrderSelect() the trade you wish to close.
First, I want to thank you for answering both of my posts... that was very kind of you...
By using the OrderClosePrice(), from what I gather by your comment --
1) The trade will definitely close
2) Slippage could be excessive
What would your preference be?
Thank you,
First, I want to thank you for answering both of my posts... that was very kind of you...
By using the OrderClosePrice(), from what I gather by your comment --
1) The trade will definitely close
2) Slippage could be excessive
Use a large slippage value and you will close at the market (the price the broker has.) But that could be very far away from the price you have (could be a minute old during new releases and/or network problems.)
use a small value and you don't close (requote.)
Use a large slippage value and you will close at the market (the price the broker has.) But that could be very far away from the price you have (could be a minute old during new releases and/or network problems.)
use a small value and you don't close (requote.)
Use a large slippage value and you will close at the market (the price the broker has.) But that could be very far away from the price you have (could be a minute old during new releases and/or network problems.)
use a small value and you don't close (requote.)
I am closing trades on a net profit basis. In order to insure a better closing price, should I use a different method? What is a large slippage number?
Also, I will have multiple orders open. It seems that one order could close and the next could order fail to close for some reason. How can I ensure that all orders close?
I am closing trades on a net profit basis. In order to insure a better closing price, should I use a different method? What is a large slippage number?
Also, I will have multiple orders open. It seems that one order could close and the next could order fail to close for some reason. How can I ensure that all orders close?
Also, I will have multiple orders open. It seems that one order could close and the next could order fail to close for some reason. How can I ensure that all orders close?
double Equity_Target_Saved;
void start(){
if( Net_Profit >= My_Goal ){ Equity_Target_Saved=AccountEquity(); }
if( Equity_Target_Saved != 0 && AccountEquity()>= Equity_Target_Saved ){ CloseAllOrders(); }
if( MyOrdersTotal() == 0 ){ Equity_Target_Saved=0; }
}
void CloseAllOrders(){
for(...............){
if ( OrdreSelect() && OrderMagic() && OrderSymbol() && Blah.Blah.Blh)
if(AccountEquity() < Equity_Target_Saved){return;}
OrderClose(Slippage=0);
} }
Well thats how I would attempt the No-Slippage solution.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to close all orders on net profit of all orders. How should I handle the slippage parameter in the ordersclose function?
Can I just close at the market?
I am rather new at this.
Thank you...