[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 252

 
Friends, can you tell me how to find out the price of the previous tick?
 
CLAIN:
Friends, can you tell me how to find out the price of the previous tick?

int start()
{
   static double prevtick=0;  // переменная для хранения значения предыдущего тика  
   double nevtick;            // переменная для хранения значения текущего тика  
   nevtick=Bid;

   //.................................
   //..какая-то обработка
   //.................................

   prevtick=nevtick;           // сохраняем значение тика для последующего анализа
   return(0);
}
It's like this
 

Thanks... all geniuses are simple =) except it gives me 3-4 decimal places, I'd rather have 5... I'm writing as written below, but it still gives me 4 decimal places, tell me why?

   static double prevtick=0;  // переменная для хранения значения предыдущего тика  
   double nevtick;            // переменная для хранения значения текущего тика  
   nevtick = NormalizeDouble(Bid,5);
 

Can anyone suggest an economic news archive for the last three years?

And to be able to download and work offline?

 
CLAIN:

Thanks... all geniuses are simple =) except it gives me 3-4 decimal places, I'd rather have 5... I write as written below, but it still gives me 4 decimal places, tell me why?


Where does it go?

PS. and Ask the previous tick do not forget to remember if the spread is floating.

 
Moved:

qaz2005 11.10.2011 09:30
Good day all! i have a custom indicator and i have two objects in it. Their values I can find out, but here is no way to distinguish them, whether it is the top line or bottom. I can not know the number and order of the buffers, when installing there are no settings. On the Internet read that the settings for the colour also go as buffers, how to refer to them through the function iCustom () or maybe any other function to work out this point?

Thanks in advance!

P.S. Is there any literature on the MQL4 language? I've already downloaded and almost finished an MQL4 tutorial.
 
PapaYozh:


Where does it go?

PS. and Ask the previous tick don't forget to remember if the spread is floating.


i.e. to buy use the Ask of the previous tick, and to sell use the Bid of the previous tick?
 
CLAIN:

In other words, to buy use the Ask of the previous tick, and to sell use the Bid of the previous tick?


I can't know what you need the previous tick for, but there are 2 prices in the tick: Ask and Bid.

But, in any case, you will not buy/sell at the previous, but at the current prices.

And when memorizing, you do not need to normalize the prices, just memorize the Ask and Bid.

 
forexnew:

I have been dealing with this issue myself recently. In addition to doing the enumeration of currencies in the EA, you need to correctly specify Point, ask, bid, digits. Swap the historical data on each currency, if it is used. If there are calculations with predefined currency iBar, iClose, also insert currency enumeration instead of NULL. Here is an example for 25 currency pairs. Maybe I am not a great expert, but I have not received a clear answer from the experts, I had to sort it out myself.


Alexander, thank you for sharing your experience! But along the way I have a question, how is currency enumeration done? Or is it the name of currency in the OrderSend() function in place of Symbol()? And could you please explain how to put your example in the code? Thanks again for your help! :)
 
skyjet:
Alexander! Thank you for sharing your experience! But I have a question, how should I do currency enumeration? Or is it the name of currency in the OrderSend() function instead of Symbol()? And could you please explain how to put your example in the code? Thanks again for your help! :)

You understand one thing - there's a currency enumeration in the loop... The only task is to know the values of environment parameters of this or that instrument you're trading, for these purposes there, as a variant prescribed by the loop -
     ...
     bid=MarketInfo(SymbolMax[nnnn],MODE_BID);
     ask=MarketInfo(SymbolMax[nnnn],MODE_ASK);
     point=MarketInfo(SymbolMax[nnnn],MODE_POINT);
     digits=MarketInfo(SymbolMax[nnnn],MODE_DIGITS);
     Startimeframe4();

If you know what instruments you are trading, then instead of a cycle in variable SymbolMax[nnnn] - explicitly specify the name of your instruments and that's all, of course not forgetting to do the necessary checks when placing order on this or that instrument and that's all...

Look, how it is organized in your tutorial - f-kind of Open_Ord(), in general, you can use Kim I.'s f-kind of owl, what I showed you earlier...

Reason: