[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 769

 
You cited part of the OpenBuyStopOrder function. HaveBuyLimitOrderEnd flag should be set in the OpenBuyLimitOrder function, when testing in the tester, replace Curr_symb with Symbol(), And your error check is oddly implemented, in your case GetLastError() will return an error after an OrderSelect function call and here may be ok, OrderSend may be erroneous .
 

Exactly, the problem is elsewhere. We have to start with logic

 
ivandurak:
the HaveBuyLimitOrderEnd flag must be set in the OpenBuyLimitOrder function,

I don't understand what HaveBuyLimitOrderEnd has to do with it.

HaveBuyStopOrder, and the flag is defined correctly but before the error pay attention to if (ticket > 0), and about Curr_symb to Symbol(), it is the same because on a global level I have string Curr_symb; // a variable for storing of a financial instrument name

I'VE ALREADY CHECKED IT 1000 TIMES, AND ALL LEADS TO ONE THING, THE WRONG OPERATOR IS SOMEHOW WRITTEN CORRECTLY, AND I CAN'T UNDERSTAND HOW IT SHOULD BE DONE CORRECTLY

 
Vinin:

Exactly, the problem is elsewhere. You have to start with the logic


THAT'S WHAT I'M SAYING, THE LOGICAL OPERATOR ISN'T WRITTEN CORRECTLY.

if(bt==1&&bl==1)
{OpenBuyStopOrder(Lot,PRAskS);
if (HaveBuyLimitOrder== true)
{ModifyBuyLimitOrder(PRAskL); //Deselect
} }

THE FIRST PART OF IT WORKS BUT HOW TO WRITE THE NESTED ONE, TOO, I CAN'T THINK

I've already tried it all

if(bt==1&&bl==1)
{OpenBuyStopOrder(Lot,PRAskS);
} else {
if (HaveBuyLimitOrder== true)
{ModifyBuyLimitOrder(PRAskL); }
} }

 

By the way, this is how it starts to modify and delete

if(bt==1&&bl==1)
{OpenBuyStopOrder(Lot,PRAskS);
} else {
if (HaveBuyLimitOrder== true)
{ModifyBuyLimitOrder(PRAskL); }
} }

but bypassing the main condition

if(bt==1&&bl==1)

 
FoxUA:

By the way, this is how it starts to modify and delete

if(bt==1&&bl==1)
{OpenBuyStopOrder(Lot,PRAskS);
} else {
if (HaveBuyLimitOrder== true)
{ModifyBuyLimitOrder(PRAskL); }
} }

but bypassing the main condition

if(bt==1&&bl==1)

It feels like your whole code is a secret behind the seven seals... And God forbid anyone should find out about it in full... Then you're screwed.

It will take you and not only you but everyone else a long time to figure out where the dog is hidden in your code.

You should have posted the whole code long ago, so that people could normally look for errors instead of guessing from coffee grounds. And your problem would have been solved long ago.
Or is it a state secret?

Looking for a cat in a dark room... IMHO. No offense.

 
artmedia70:
It feels like your whole code is a secret behind the seven seals... And God forbid anyone should find out about it in full... Then you're screwed.

It'll take you a long time, and not just you but everyone else, to figure out where the dog is buried.

You should have posted all your code long ago so people could properly look for errors instead of guessing by coffee grounds. And your problem would have been solved long ago.
Or is it a state secret?

Looking for a cat in a dark room... IMHO. No offense.


I have already posted it, if you don't remember and what you said! No offense, but there is a specific problem in a specific place why give unnecessary sense about if you really help, I'll post it,

Files:
test18.mq4  20 kb
 
FoxUA:

The code is very simple and consists of several operators, but they are identical and the function of opening and removing modifications is not super natural, I just posted it already if you do not remember and what you said! No offense, but there is a specific problem in a particular place why give extra meaning to the if you really help, please, I'll post it,

Honestly - I don't remember what I said... I think I don't need to remind you, I'll find the post when I have time :)
 
artmedia70:
Honestly - I don't remember what I said... I don't think I need to remind you, I'll find the post when I have time :)

It doesn't matter what the doctor said, what his condition is, what the diagnosis is.

 
FoxUA:

It doesn't matter what the doctor's condition is, what's the diagnosis

Sorry, but the doctor is very busy with another patient... :) I don't have time to look at the code at all, much less get into it...
I think there are many more doctors professors and academics here... :)
Reason: