MQL5 CopyLow returns Bid prise - page 2

 
Keith Watford:
Chart prices are always the Bid price.

Sorry, but they are not :


As I told already : it entirely depends on the broker and neither of the prices needs to be exactly the same to any of the chart prices

 
Zar88:
@ Alain
Then the Solution is =>i need to take Bid and add spread myself to simulate an Ask.

Looked to me like a "un-"cleanest way to do .... but knowing that there is no AskHistory
i can make it work this way - thanx....
Depending of your needs you could also use CopyTicks(), it will give you all prices and more.
 
Hole NEW WOLD :-) !!!!!!  i'll work with - once i understood to handle the limit of 2000 ticks .... thanx !!
 
Alain Verleyen:
Depending of your needs you could also use CopyTicks(), it will give you all prices and more.
Yes, that works as expected (and assumed :))
 
This is how it works with a "simulatad Ask":                        

double   highest = 0;
double   lowest = 0;  
int      TrailingCandles = 2;
int      minIdx;

   //-- Hochpreis aus X(TrainilgCandles) Candels
         double high[];
         ArraySetAsSeries(high,true);
         CopyHigh(_Symbol,_Period,0,10,high);
         minIdx = ArrayMaximum(high,0,TrailingCandles);
         highest = high[minIdx];

   //-- Tiefpreis aus X(TrainilgCandles) Candels
         double low[];
         ArraySetAsSeries(low,true);
         CopyLow(_Symbol,_Period,0,10,low);
         minIdx = ArrayMinimum(low,0,TrailingCandles);
         lowest = low[minIdx];



double   myAsk = (SymbolInfoDouble(Symbol(),SYMBOL_ASK));
double   myBid = (SymbolInfoDouble(Symbol(),SYMBOL_BID));

double   mySpread = NormalizeDouble((myAsk-myBid),6);
double   LowestBidPlusSpread = NormalizeDouble(lowest + mySpread,6);

/*
Print(
      "LOW - lowest ", lowest,
      " - Spread ",mySpread,
      " - LBPS =", LowestBidPlusSpread ,
      " - myAsk ",myAsk );
*/

if( NormalizeDouble(myAsk,5) == NormalizeDouble(LowestBidPlusSpread,5)) Print("LOW!!!");


/*
Print(
      "HIGH - highest ", highest,
      " - myBid ",myBid );
*/

if( NormalizeDouble(myBid,5) == NormalizeDouble(highest,5)) Print("HIGH!!!");

Print("just a Tick... ..  ."); 

 
 ... C U
 
Keith Watford:
Chart prices are always the Bid price.

It's either Bid price, or Last price (see Mladen post and screenshot). It depends if the broker provides Depth of Market data or not.

Bars in the platform are formed based on Bid prices (or Last prices if the depth of market is available for the instrument).

 
Zar88:
Hole NEW WOLD :-) !!!!!!  i'll work with - once i understood to handle the limit of 2000 ticks .... thanx !!

The limit of 2000 ticks, is only in the case when you do not specify a 'from' and a 'count'. When you do specify them, you can get much more (with some delays) as explained in the documentation:

The rate of data return: the terminal stores in the fast access cache 4,096 last ticks for each instrument (65,536 ticks for symbols with a running Market Depth). If requested ticks for the current trading session are beyond the cache, CopyTicks() calls the ticks stored in the terminal memory. These requests require more time for execution. The slowest requests are those requesting ticks for other days, since the data is read from the disk in this case.

 
Zar88:
Hole NEW WOLD :-) !!!!!!  i'll work with - once i understood to handle the limit of 2000 ticks .... thanx !!
Maybe the new CopyTicksRange() is more adapted for you. But honestly I didn't try it yet.
 
Alain Verleyen:

It's either Bid price, or Last price (see Mladen post and screenshot). It depends if the broker provides Depth of Market data or not.

I must admit that I have done very little with MT5, I didn't realise this.