[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 330

 
artmedia70:

The indicator cannot open orders. These things are handled by the EA. If this code belongs to the indicator, then you need to output the data into its buffer, which is created specifically for this data. When there is no signal, a zero or an empty value is written to the buffer. When a signal arrives (as in your example), instead of Alert(); write the value in the buffer.
For example:
+1 for Buy and
-1 for Sell.
Then read data from the buffer in the Expert Advisor using iCustom();.

Or write all these conditions directly in the Expert Advisor.

I'm sorry for dumbness, but how to make data output to the buffer and how to read them from the buffer - is there any example?

"When there is no signal, you write zero or an empty value in the buffer and when you get a signal (as in your example), instead of Alert(); write the value in the buffer."

I've never dealt with indicators, it's just that I don't know what to do with them.

 
Can you tell me how to determine the maximum bar size (i.e. High-low greater than the others) among the last three (without zero)?
 
Timofei:
Can you tell me how to determine the maximum bar size (i.e. High-low greater than the others) among the last three (without zero)?
High(iHighest(Symbol(),0,MODE_HIGH,3,1)
Low(iLowest(Symbol(),0,MODE_Low,3,1)
 
todem:

no
 
Timofei:
Can you tell me how to determine the maximal size of a bar (i.e. high-low greater than the others) among the last three (without zero)?


The answer is a straightforward solution. Say X3 = iHigh[3]-iLow[3]...- this is for the 3rd last, similarly calculate for the 2nd and 1st by writing 2 and 1. You will have three variable values X3, X2, X1. Further, they are compared to each other - you get the maximum size of the bar in absolute values of the instrument price, for example, X2 is greater than X1 and X3 - we put its value into the variable Max and divide Max by Point and the result will be "the maximum size of the bar in pips of the last three (without zero)".

P.S. Max = max X2 or X1 or X3 - after they are compared; REZULT = Max/Point; Something like this.

 

Good afternoon!

Question:

Let's say I wrote my indicator ("test123"), I call it in Expert Advisor through iCustom:

iCustom(Symbol(), Period(), "test123", 1, 1, 0, 1);

Can I check if the call was successful? GetLastError() is zero in any case, I checked

 
Roger:
Maybe because the range is too small, only 4 seconds? There are few ticks in the bar at that time and the tester may not hit the set interval.


Yes, you're right, I have corrected some of my deals by increasing the time range. And I've found the reason for others, it turns out that there is not enough data in the history (for example, the last one-minute bar on 24.08.2011 was at 23.57 and then the failure after which I start a new day immediately.

Thank you!

 

1. How do you determine the profit/loss of the last trade?

2. In the tester, are the results shown including the spread, or do I need to subtract the spread from each trade?

 
Can you tell me why the "symbol,period" field pops up when you press the space bar on the graph?
 
vitali_yv:
Can you tell me why the "symbol,period" field pops up when you press the space bar on the chart?

for programmers.

They can switch between currencies, timeframes or left bars.


Reason: