[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 339
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I wasn't talking about external variables. I was talking about this.
Let's imagine a situation. A decision has to be made according to the last open position.
For the tester:
We create variables, in which we will store the necessary data of the last opened position.
As soon as a new position is opened, we will immediately add the required data into these variables.
When a signal to open a next position comes (for example, after 20 tester minutes), we need to check some criteria, by which we decide on the data of the position to be opened. These criteria, by convention, depend on the previous position opened. We read them from variables (we saved them at the previous opening) and use them as additional data for a new position.
When we open a position, we store the new data about the newly opened position in the variables.
For real:
Let's imagine the same situation, but ... Imagine that after the last position was opened and its data stored in variables, 10 minutes have passed (another 10 minutes have to pass before the next position is opened (we have just assumed this in a 'tester')). And in this interval of time, the Expert Advisor was restarted for some reason.
What happens after the restart of the EA with data of the last opened position, which was stored in variables? They will not exist.
So where do we need to get them? Right - search. This is why we need the function of searching for the necessary data. It is therefore better to find everything at once, when we need it, and not store it in variables, which is really much easier and faster.
Sorry for the late clarification - just got out into the world ... :))
Help me deal with the logic, I can not somehow translate the simple logic into the program (can you recommend some literature)
The challenge: Calculate maximal (minimal) RSI at values above 70 (below 30) and draw a down (up) arrow above the bar
at these values.
Implementation (first part, the second part is similar):
1. calculate the RSI value for each bar
2. while RSI is greater than 70 fill the RSI buffer with its values
3. find the position of the maximal value in the array
4. look for the bar with the RSI value equal to the maximum RSI value in the array
5. draw an arrow above this bar.
Well, there is something like this, but while writing the code, I have a lot of questions, errors and am in a mess(((
And here is the implementation in the code.
Gentlemen, please advise how to encode the following algorithm using a loop.
if (iLow (Symbol (),0,1) > iLow (Symbol (),0,10))// if the MINIMUM of the first candle > MINIMUM of the tenth candle
OrderSend(Symbol(),OP_BUY,0.1,Ask,1,Bid-2950*Point,Bid+150*Point, "jfh",123 ); // open the order.
I HAVE TO
If Low 1 and simultaneously Low 2 and simultaneously Low 3...... . ...and simultaneously Low 9 candle> Low 10 candle ( i.e.Low candle from 1 to 9)
/ /open order.
Thank you.
Gentlemen, please advise how to encode the following algorithm using a loop.
if (iLow (Symbol (),0,1) > iLow (Symbol (),0,10))// if the MINIMUM of the first candle > MINIMUM of the tenth candle
OrderSend(Symbol(),OP_BUY,0.1,Ask,1,Bid-2950*Point,Bid+150*Point, "jfh",123 ); // open the order.
I HAVE TO
If Low 1 and simultaneously Low 2 and simultaneously Low 3...... . ...and simultaneously Low 9 candle> Low 10 candle ( i.e.Low candle from 1 to 9)
/ /open order.
Thank you.
We create a condition success flag, set it in tru, pass the required number of candles in the loop, if at any of them the condition is not met, set the flag in the false flag and exit the loop.
Create a condition success flag, set it in the pipe, pass the required number of candles in the loop, if at any of them the condition is not met, set the flag in the false flag and exit the loop.
Thank you very much.Sorry for God's sake.... I am still a bit slow in understanding what you have written.
I would be very grateful if you could write code..... and then I would understand everything.
bool have = true;
for(int i=0;i<10;i++){
if(Low[i]<=Low[i+1]){have=false; break;}
}
if(have){
// действия если условие соблюдено
}else{
// действия если условие не соблюдено
}bool have = true;
for(int i=0;i<10;i++){
if(Low[i]<=Low[i+1]){have=false; break;}
}
if(have){
// действия если условие соблюдено
}else{
// действия если условие не соблюдено
}people, how do you close a pending order in n, number of pips if it has not triggered?