[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 263

 
Folks, could you please tell me if there is any way to fix the floating spread in MT4? I need it for testing purposes.
 

Could you please tell me where I can find the description of PerkyAsctrend1 indicator? Not a code, but how it works?

Thank you in advance!

 
VeyRON123:
Folks, could you please tell me if there is any way to fix the floating spread in MT4? I need it for testing purposes.

Disconnect from the internet. The current spread will be fixed with the last value.
 
Zhunko:
Haven't checked, but I doubt it works in that direction. The file is probably only readable when MT4 starts. In other cases it only works for writing to MT4.
Checked, confirm: the file is indeed read only when the terminal starts.
 

Can anyone advise how to properly design the function of closing an open position and opening a new one based on a reverse signal?

One more question... How do I correct the error... If an order is opened by a triggered take and the EA immediately opens an order on the first tick, without waiting for a new signal? How to fix this glitch?

Thanks in advance...

 
ostrik:

Can you guys tell me how to properly design the function of closing an open position and opening a new one by a reverse signal?

And one more question... How do I correct the error... If an order is opened by a triggered take and the EA immediately opens an order on the first tick, without waiting for a new signal? How to fix this glitch?

Thanks in advance...

Do you trade manually? How would you decide whether or not to open your next position if you were trading manually? What conditions would you use?
The Expert Advisor should do, and does, only what you told it to do. What condition have you missed, since it still considers the past signal to be valid?
After all, this is the simplest logic. Everything in programming is based on it. Think what condition you failed to describe for it to do what you want it to do...

And until you learn to program in strict compliance with the necessary logic, you will always find logical errors. And believe me, this is the hardest part.
If the compiler will tell you about syntax errors, you need only to take care of logical errors yourself.

Let's consider my post as your homework... :))
 
ostrik:

Can you guys tell me how to properly design the function of closing an open position and opening a new one by a reverse signal?

And one more question... How do I correct the error... The order is opened by the signal, Take has triggered and the EA immediately opens an order using the old signal without waiting for a new one? How to fix this glitch?

Thanks in advance...


1.Just for fun, read the tutorial here - second fiia on top of the page (adjust it for yourself), and also look here - page 2 - yours - completely fiia developed by Kim IV. As for opening on signals, including reverse signals - also look at the tutorial here and on the previous link to the tutorial - order opening fiia.

If the entry conditions are met, it already doesn't matter what kind of signal you are dealing with, be it inverse or not. In general, you need a code, if you ask for help. There are no telepaths here, though... who knows...

For example, you can check out the last post on this page branch - processing login conditions.

P.S. Before you ask questions, well... At least for fun, look in a textbook and, as they say, search rules.

 
Please tell me how to change the background on the chart in the template for mt4 or is there a program?
 
ostrik:

One more question... How do I fix this bug... The order is opened by the signal, Take has triggered and the EA immediately opens an order by the old signal without waiting for a new one on the first tick? How to fix this glitch?

Thanks in advance.

As an option, I can suggest you this method. It will at least help at first.

Suppose the Expert Advisor works on timeframe = H1. Then, to open a position by your indicator's signal, you set an additional condition that will not open more than one position per day.

I gave an example of such a function yesterday at https://www.mql5.com/ru/forum/132500/page2

In your case it looks like this

if ( NumberOfBarOpenLastPos(NULL, 1440,OP_SELL, Magic) !=0 ) //// if there is no position opened on current day

or

if(NumberOfBarCloseLastPos(NULL, 1440,OP_SELL, Magic )!=0 //if this day the position has not been closed

or both of these conditions can be combined with the "or" operator.

You can also use these functions to solve your problem differently. For example, you can set the condition that the next position according to your signal will be opened not earlier than the specified number of bars in the current chart, after the previous position has been closed:

if(NumberOfBarCloseLastPos(NULL, 0,OP_SELL, Magic ) >N_bars )// - opening is allowed

Both functions can be found at https://www.mql5.com/ru/forum/131859 (4th page, I think).

or in old branch of Igor Kim.

 
leonid553:

Disconnect from the internet. The current spread will be fixed - the last value.

Is there any way to disconnect MT4 itself from the internet without cutting off the internet on the computer?