[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 344

 
drknn:


If the spreads change, the minimum allowable distance for placing pending orders and placing stop orders will also change.

This should be written inside the "start" function. Then it will be checked on every tick and if the minlevale has changed, it will be reflected in the variable.

thanks)
 
Do you know how to make an EA memorize a certain bar? I was thinking about putting it into an array, but then I realized that the bar will move, but its index will constantly change... advise how to do it better plz
 
CLAIN:
Could you advise how to make the EA memorize a certain bar? I thought about including it in an array, but then I realized that the bar will move, but its index will constantly change... advise how to do it better pls

When it is time to memorise the desired bar, memorise its time (e.g. - time of current bar = 0, previous bar = 1, etc.):

datetime TimeBar=iTime(Symbol(),Period(),0); // 0 = время текущего бара, 1 = предыдущего бара и т.д. ...

Now you can find out its index at any time:

int nBar=iBarShift(Symbol(),Period(),Time[TimeBar]);

Instead of Symbol() and Period(), you can substitute the specific values of a particular symbol and period of the chart.

This example uses the values of the current symbol and period.

 
Afternoon. Here is the problem: An EA has opened an order at 15 min. After some time (in a day, an hour, or a few minutes) the order has closed at TP (e.g. 25 pips), but the condition is still active for the next 15 min. What do I need: I do not want to open another order within a day using already open condition.
 
MOHCTP36:
Hello, I would like to ask you to solve a problem: if an EA has opened an order for 15 min, after some time (like in a day, hour, or few minutes) the order has closed with TP (e.g. 25 pips), but the state continues to work for the next 15 min. What should I do if I do not open another order within a day based on a previous order that has already triggered.

Use flags.

For example:

Declare variable bool CondIsHandled = false; (Condition processed = no)

If there is no condition to open -> set variable to false

If there is a condition to open a position, then we first check the state of that variable before opening it:

if (!CondIsHandled) { operations to open an order }

After a position is successfully opened, set this variable to true

So, we set a certain trigger that is set in the function looking for signals to open and is removed in the function that opens positions:

1. If there is no signal to open a position - > CondIsHandled = false;

2. If there is a signal to open a position and the position is opened based on this signal - > CondIsHandled = true;

You can arrange two independent variables for Buy and Sell signals -> CondIsHandled_B = false; and CondIsHandled_S = false;

I hope I explained it clearly...

 
Help me write the trading criteria. If the price exceeds the value of the last fractal upwards, a buy position should be opened and if the price is downwards, a sell position should be opened. I will finish the rest myself. I can't save the value of the last fractal.
 

Hello Dear forum members. I need your help. I cannot find any detailed description of IND Inverse indicator. (I can't find any information about it at all.)

Here is the link to it: https://www.mql5.com/ru/code/8906

Any help would be appreciated.


 
geem:

Hello Dear forum members. I need your help. I cannot find any detailed description of IND Inverse indicator. (I can't find any information about it at all.)

Here is the link to it: https://www.mql5.com/ru/code/8906

Any help would be appreciated.


Askthe author in a private message...
 
chuvee:
Help me write the trading criteria. If the price exceeds the value of the last fractal upwards, a buy position should be opened and if the price is downwards, a sell position should be opened. I will finish the rest myself. I cannot save the value of the last fractal.
IFractals();
 
chuvee:
Please help me with the trading criteria. It is necessary, that if the price exceeds the value of the last fractal upwards, then buy position should be opened, and accordingly, if the price descends, then sell. I will post the rest myself. I cannot save the value of the last fractal.


Learn to use Google search: How to know the price of the last fractal at site:mql4.com.

See this branch page.

This information is also available onthe 'Forum Navigator... "is available on this page.

Reason: