[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 549

 
pu6ka:
Now I see. Most likely, you have to create an array for MA values and then a second array to store the max values, or a variable if only the last max value is needed.


That's the question, I don't know how to do it. It needs to be in the form of an indicator, i.e. not just the last value.
 

Shall I mark the curves with arrows?

 
pu6ka:

Shall I mark the curves with arrows?

No, you need a step line. Although in this case it's not really a step line... Can you post this indicator? I mean the one in the picture. I'll look into it...
 
Arles:
No, I need a line in steps. Although, it will not be quite steps in this case. Can you post this indicator? I mean the one in the picture. I'll look into it.

This is the ROC speed indicator from the textbook, slightly modified. There is a reference line, a velocity line and a smoothed line from it. The intersection between the velocity line and its period average is indicated by an arrow. I just discoloured all but one in the screenshot.

But you probably need an algorithm that marks by an arrow the maximum and minimum MA value on this interval every n bars?

Files:
 
Usual_Trader:

The Ticket error is most likely because your Ticket variable is initialized twice - at the beginning and in the function

Try another name in the function, at leastTicket1 :)


Thank you)), It gave me another idea, I've figured it out))
 
pu6ka:


If the variable is declared on the global level, then it does not need to be passed to its own functions, just use variables Ticket and Ans, they will be visible in functions.

You write in the comments that M_1 and S_1 are the first bar, and in the iStochastic() function you extract the value for them on the zero bar. If you really need data on the zero bar, then first of all, check for closing orders and then, if you are going to work with one order, exit by condition: if(Total > 0) return; and only then a condition for a new order opening. If you are planning to work on large TFs, then it would be better to replace the exit condition with the following one: if the order is opened on the current bar, nothing new is opened on the current bar yet. Otherwise, on H4, an order may open on one bar several times and trigger a stop loss on one condition.

Here is what is happening at the moment: the main bar has crossed the signal one, for example, upwards, the buy order is opened. On the next tick, the condition is saved, but you have Total more than zero and the close condition tries to trigger, and you try to use your Close_Order_S() function to close the Buy position at Ask price. Check the order type and one function to close it, pass Ask or Bid into parameters, depending on the order type.


Thank you very much)), order closing works, no errors, but again the criteria doesn't work as it should((, code and screenshot attached, Help please...
Files:
 
Equilibrium:

Thank you very much)), order closing works, no errors, but again the criteria does not work as it should((, code and screenshot attached, Help please...
        if (Total>1)                           // Вместо этой строки           
        if (Total>=1)                          // Поставьте эту
        if (Total>0)                           // Или эту

 
Tell me, do you have $5,000 you don't mind putting it in your account? How safe is it?
 
Beowulf:
Tell me, do you have $5,000 you don't mind putting it in your account? How safe is that?

Who says 5,000? Start with 100, test yourself and your broker, and then decide for sure! The money is yours!
 
Can you advise an EA to place a pending order on the parabolik SAR indicator and trawl it accordingly... thanks
Reason: