Errors, bugs, questions - page 2350

 

Hello

Did I miss something or is it now possible to send bylimit orders above the current price and so that they are immediately executed. Like on a real stock market system?

Like limiting slippage?

 

I can't figure it out, so please give me a hint. There is a time acquisition

int GetHandle() { return(0); }

bool SelectHandle( int ) { return(true); }
  
int NewHandle = 0;  
int PrevHandle = GetHandle();    

datetime time = SelectHandle(NewHandle) ? TimeCurrent() : 0;  
SelectHandle(PrevHandle);


How to write a macro that does the same thing

time = MACROS(NewHandle, TimeCurrent()); // Макрос


The problem is that PrevHandle is not created in the macro.

 

Hi all.

Terminal build 1960 (same in beta 1966). Functions CopyTicks, CopyTicksRange work correctly in the indicator, running in the terminal, but in the tester, the same indicator in these functions shows -1 result and error 4014. Developers, please advise why?

 
fxsaber:

How to write a macro that does the same thing

What's wrong with a function?
 
Alexey Navoykov:
What's wrong with the function?

Because instead of TimeCurrent, it can be any function at all.

 
fxsaber:

The fact that instead of TimeCurrent, it can be any function at all.

Well then, only if a global variable is used.
 
fxsaber:

How to write a macro that does the same thing

The problem is that PrevHandle cannot be created in the macro.

I think the big problem is that there is no comma operator, without it it is unlikely to get such a macro.

 
Typical syndrome of unrecognised geniuses... Talking about high things and not being able to solve the simplest problem...
Think about it... for a week
Hint: The fact that the solution in MQL already exists is a hint in itself.
 
pavlick_:

In my opinion, the big problem is that there is no comma operator, without it you're unlikely to get such a macro.

You could do this:

int MACROS_helper_int;
#define  MACROS(NEW_HANDLE_, FN_)  (MACROS_helper_int=GetHandle())*0+(SelectHandle(NEW_HANDLE_) ? FN_ : 0);  \
                                  SelectHandle(MACROS_helper_int);

But crusty, you can't put it somewhere in a condition, only through =.

SZY: and carefully use in after if, while, etc.

if(true)
   MACROS(...);

I probably wouldn't use one.

 
A100:
Typical syndrome of unrecognised geniuses... Talking about high things and not being able to solve the simplest problem...
Think about it... for a week
Here's a hint: the fact that the solution in MQL already exists is a hint in itself.

Well, come on, you, master, surprise the plebs with a brilliant solution.

Reason: