hi, what is that meant your requirement to check on each new candle was solved by my code above?
I tried here, and it works.
hi i tried your method too thanks, but my problem is that when trade is open it closes on new bar and opens a new trade. It should not do that it should wait for the trailing stop to be hit.
hi i tried your method too thanks, but my problem is that when trade is open it closes on new bar and opens a new trade. It should not do that it should wait for the trailing stop to be hit.
yes, I understand what you meant :)
you should record (counted in a variable) your previous position before do something again at new candle to come.
maybe you need to create a flowchart before start writing your program.
hi i tried your method too thanks, but my problem is that when trade is open it closes on new bar and opens a new trade. It should not do that it should wait for the trailing stop to be hit.
Btw, I can't find OrderClose() in your code :)
Can you please show me?
and also, you have some loops in a cycle.
example:
int trail()
{
string Symb=Symbol(); // Symbol//------------------------------------------------------------------------------- 2 --for(int i=1; i<=OrdersTotal(); i++) // Cycle searching in orders
{
if (OrderSelect(i-1,SELECT_BY_POS)==true) // If the next is available
{ // Analysis of orders:int Tip=OrderType(); // Order type
should be :
int trail()
{
string Symb=Symbol(); // Symbolinttotal_order = OrdersTotal();
//------------------------------------------------------------------------------- 2 --for(int i=1; i<=total_order; i++) // Cycle searching in orders
{
if (OrderSelect(i-1,SELECT_BY_POS)==true) // If the next is available
{ // Analysis of orders:int Tip=OrderType(); // Order type
2 code above is looks the same, but actually both of them are different in results and performance :)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
hi, what is that meant your requirement to check on each new candle was solved by my code above?
I tried here, and it works.
hi i tried your method too thanks, but my problem is that when trade is open it closes on new bar and opens a new trade. It should not do that it should wait for the trailing stop to be hit.
hi i tried your method too thanks, but my problem is that when trade is open it closes on new bar and opens a new trade. It should not do that it should wait for the trailing stop to be hit.
yes, I understand what you meant :)
you should record (counted in a variable) your previous position before do something again at new candle to come.
maybe you need to create a flowchart before start writing your program.yes, I understand what you meant :)
you should record (counted in a variable) your previous position before do something again at new candle to come.
maybe you need to create a flowchart before start writing your program.but CheckOpenOrders should be returning true/false instead. then:
hi i tried your method too thanks, but my problem is that when trade is open it closes on new bar and opens a new trade. It should not do that it should wait for the trailing stop to be hit.
Btw, I can't find OrderClose() in your code :)
Can you please show me?
and also, you have some loops in a cycle.
example:
should be :
2 code above is looks the same, but actually both of them are different in results and performance :)
later you will understand that.
Btw, I can't find OrderClose() in your code :)
Can you please show me?
and also, you have some loops in a cycle.
example:
should be :
2 code above is looks the same, but actually both of them are different in results and performance :)
later you will understand that.
it doesnt have OrderCLose, just trailing stop and OrderSend. thanks for the extra info.....
Hi ztmalick,
This is what I am looking to do. Did you manage to fix your code in the end?