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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all!
Can you please help me with this question?
I'm trying to get the exact value of opening(Open[i]) or closing(Close[i]) of EURUSD currency pair with five-digit value after zero, but in response I always get rounded value!
Hello.
I have a question as a beginner:
how to get data in MQL4 about the current "Profit" by open positions and total; how to get data about the current balance.
The Documentation has an account information item. if there is no function for any order information, you have to go through all orders and get the required information for the right ones.
Can you tell me how to determine whether a candle closed below or above a certain Fibonacci level?
Close[i] is clear, but how do I know where the level is relative to price?
use DoubleToStr(value, Digits) when displaying the value;
Thank you very much!
I've already figured it out, searched the whole forum, on this topic, but no one has answered clearly, that in fact everything is simple.
It turns out that the value is rounded to 4 digits only when trying to print it using Alert(), Comment() or Print() without DoubleToStr(value, Digits).
And to calculate the program uses the values without rounding to the 4th sign, if you want to round must use the
NormalizeDouble( value, Dijist).
So you should just read the help more attentively and everything will be fine ;)
Can you tell me how to determine if a candle closed below or above a certain Fibonacci Fan level?
Close[i] is clear but how do I know where the level is relative to the price?
The level price must be requested programmatically. For this purpose, you must have previously placed and configured (all programmatically) the "Fibo" object on the chart. This is not as easy as it may seem at first glance. However, Gods do not burn the pot. I once had to play with Fibo levels. And now I am working with processing of these levels. In general, if you want you can figure it out.
Here is an example of code to create a Fibo on a chart.
I had to make a subroutine to request the price of the level. Here it is (you can figure it out if you want)
Good evening! I myself last night reviewed the book, new dimensions of trading, Williams, yesterday to 30, today to 50 pages.
I've got a robot, but it does not work at all, no trades in the tester, and Alert("buy",GetLastError()) says nothing.
I would love to take any sound advice, please.
//+------------------------------------------------------------------+
//| Aligator.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
extern int jaw_period=13,teeth_period=8,jaw_shift=8,tteeth_period=5,teeth_shift=5,lips_period=3,lips_shift=3;
extern double volume=0.1,stoploss=20,takeprofit=50;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int tiket;
int start()
{double blu,red,grin;
//----
blu= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATORJAW, 0) ;
red= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATOREETH, 0) ;
grin= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATORLIPS, 0) ;
//----
double Fractalu,Fractall;Fractalu=iFractals( 0, 0, MODE_UPPER, 0) ;Fractall=iFractals( 0, 0,MODE_LOWER, 0);
if (Fractalu>0&&Fractalu>blu&&Fractalu>red&&Fractalu>grin)
{ tiket= OrderSend( 0, OP_BUY, volume, Bid, Point*3, Bid- stoploss*Point, Bid+ takeprofit*Point, "Pose66", 1234567890, 0, Red);Alert("buy",GetLastError());}
if (Fractall>0&&Fractalu<blu&&Fractalu<red&&Fractalu<grin)
{ tiket= OrderSend( 0, OP_SELL, volume, Ask, Point*3, Ask+ stoploss*Point, Ask- takeprofit*Point, "Pose66", 1234567890, 0, Blue);Alert("sell",GetLastError());}
return(0);
}
//+------------------------------------------------------------------+
Good evening! I myself last night reviewed the book, new dimensions of trading, Williams, yesterday to 30, today to 50 pages.
I've got a robot, but it does not work at all, no trades in the tester, and Alert("buy",GetLastError()) says nothing.
I would love to get any sound advice, please.
//+------------------------------------------------------------------+
//| Aligatorny.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
extern int jaw_period=13,teeth_period=8,jaw_shift=8,tteeth_period=5,teeth_shift=5,lips_period=3,lips_shift=3;
extern double volume=0.1,stoploss=20,takeprofit=50;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int tiket;
int start()
{double blu,red,grin;
//----
blu= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATORJAW, 0) ;
red= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATOREETH, 0) ;
grin= iAlligator( 0, 0, jaw_period, jaw_shift, tteeth_period, teeth_shift, lips_period, lips_shift, MODE_SMA,PRICE_CLOSE,MODE_GATORLIPS, 0) ;
//----
double Fractalu,Fractall;Fractalu=iFractals( 0, 0, MODE_UPPER, 0) ;Fractall=iFractals( 0, 0,MODE_LOWER, 0);
if (Fractalu>0&&Fractalu>blu&&Fractalu>red&&Fractalu>grin)
{ tiket= OrderSend( 0, OP_BUY, volume, Bid, Point*3, Bid- stoploss*Point, Bid+ takeprofit*Point, "Pose66", 1234567890, 0, Red);Alert("buy",GetLastError());}
if (Fractall>0&&Fractalu<blu&&Fractalu<red&&Fractalu<grin)
{ tiket= OrderSend( 0, OP_SELL, volume, Ask, Point*3, Ask+ stoploss*Point, Ask- takeprofit*Point, "Pose66", 1234567890, 0, Blue);Alert("sell",GetLastError());}
return(0);
}
//+------------------------------------------------------------------+
"Everything has already been stolen before you", as well as "Your horses are quietly galloping"... :-)))
See here.
Thank you!!!
But I also wanted to learn how to code, so I wanted to understand what's wrong.
What could be causing the error (wrong price)?