Questions from a "dummy" - page 64

 
Europa:
Can you please tell me why the alert is giving out Orders_Total=1, when in fact there is one position and one order, i.e. in theory it should give out 2, not 1

Try running the cycle backwards, from the end.

string Symb="EURUSD";
  for(i=OrdersTotal()+PositionsTotal()-1;i>=0;i--)
     {
      if(Symb==PositionGetSymbol(i)) Orders_Total++;
     }
     Alert(Orders_Total);
 
tol64:

Try running the cycle backwards, from the end.

Didn't help ;(
 
Europa:
Didn't work ;(

Ah, you only have a position check:

if(Symb==PositionGetSymbol(i)) Orders_Total++;
That's where only positions are counted.
 
tol64:

Ah, you only have a position check:

That's where only positions count.
SO!!!! Thank you so much!!!
 
tol64:

The reference says that:

Either the date (year, month, date) or the time (hours, minutes, seconds) or all together can be omitted. The range of values is from 1 January 1970 to 31 December 3000.

Examples:

D'2004.01.01 00:00' // New Year
D'1980.07.19 12:30:27'
D'19.07.1980 12:30:27'
D'19.07.1980 12' //new year d'1980.07.19 12:00:00'
D'01.01.2004' //equivalent D'01.01.2004 00:00:00'
D'12:30:27' //equivalent to D'[compile date] 12:30:27'
D' '//equivalent to D'[compile date] 00:00:00''

...

Or am I misunderstanding this?

The help will be amended so that such questions don't arise in the future. Thank you.
 
Europa:
It didn't help ;(

Why are you adding flies and cutlets and then determining how many cutlets there are?

Orders count separately, positions separately. PositionGetSymbol() returns only the presence of a position by symbol, and does not say anything about orders. Since there is only one position, it gives out 1. And you're still lucky, since the loop parameter goes beyond the acceptable values (PositionsTotal), you can get anything you like.

P.S. You've already replied, I'm late.

 
I couldn't find any internal function or property to give the selectable property to a graphical object (by default, the object is drawn programmatically without the possibility of selecting it with the mouse). Obviously, the question is: is it possible to give a graphical object such a property normally, without additional libraries and other wizardry?
 
x100intraday:
I could not find any internal function or property to give the selectable property to graphical object (by default the object is drawn programmatically without selecting it with mouse), I found it only in the included graphics library. Obviously, the question is: is it possible to give a graphical object such a property normally, without additional libraries and other wizardry?

ObjectSetInteger

with prop_id=OBJPROP_SELECTABLE

 
Valmars:

ObjectSetInteger

with prop_id=OBJPROP_SELECTABLE

Thank you very much.
 
bool ExtFunc (string str, int P, int i)
  {
   if (high[i] < high[i-1]) return(false);
   return(true);   
  }

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   int i=0;
   if ExtFunc("s",60,i) == 1)
     Buffer[i] = high[i];
  }

InOnCalculate I can easily use array elements like high by index. Is it also possible to access the index elements of this array in ExtFunc? When calling my function, should I pass the array-argument by reference, via pointer or something else? So far I've managed to minimize the error messages to: "'high' - parameter conversion is not allowed" and "'high' - constant variable cannot be passed as reference" regarding the same line of my function call with the array argument from OnCalculate. Is it hopeless or is there a solution?

So far in OnCalculate I have resorted to copying high to another array:

ArrayCopy(CopyOfHigh,high,0,0,WHOLE_ARRAY);
and then using CopyOfHigh in ExtFunc instead of using high-array directly.