Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 71

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
I need the indicator to draw arrows on the daily chart. I assume that the problem is in the use of 15 minute EMAs, everything works on the 15 minute EMAs. Is it possible to make an indicator that is calculated from the 15-minute timeframe and draw arrows on the daily chart?
Below is the code itself:
dist = MathAbs((NormalizeDouble(Bid,Digits)-
NormalizeDouble(ObjectGetValueByShift(TrendLineName,0),Digits))*MathPow(10,Digits));
The code finds the distance from the current price level to the trend by TrendLineName. But there is a problem: apparently the trend is inaccurately transmitted between halves, and therefore the distance to price is quite different for different halves. How to get around this problem? Ideally, even if the trendline is displayed only on H1, at open time frame W1 (in fact at any open time frame) the calculated distance should be the same.
Related to the question in the quote above, another question: how do I simulate a different time frame than the open one on the chart? I.e., for example, with D1 open, should I calculate on M30?
//+------------------------------------------------------------------+
//| sobstvennyi_probnyi_sovetnic.mq4 |
//| Antonico |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Antonico"
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialisation function |
//+------------------------------------------------------------------+
double lot=1;
extern double sl=30;
extern double tp=30;
extern double koeff=2;
int pon=1;
int vtor=0;
int sred=3;
int hetver=0;
int patn=0;
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ int otkrord=OrdersTotal();
if (DayOfWeek()==pon || DayOfWeek()==vtor || DayOfWeek()==sred || DayOfWeek()==hetver || DayOfWeek()==patn || DayOfWeek()==6 || DayOfWeek()==0 || otkrord >0) return(0);
if(OrdersHistoryTotal()==0)
{lot=1;}
if(OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY))
{
if (OrderProfit()>0)
{
lot=1;
}
if (OrderProfit()<=0)
{
lot=OrderLots()*koeff; // Multiply by 2
}
}
int h=TimeHour(TimeCurrent());
int m=TimeMinute(TimeCurrent());
int s=TimeSeconds(TimeCurrent());
double zena0=Open[3];
double zena01=Open[2];
if (h==1 && m==00 && s==01 && zena0<zena01 )
{OrderSend(Symbol(), OP_BUY,lot,Ask,3,Bid-sl*Point,Ask+tp*Point,"",0,0,Green);}
if (h==1 && m==00 && s==01 && zena0>zena01)
{OrderSend(Symbol(), OP_SELL,lot,Bid,3,Ask+sl*Point,Bid-tp*Point,"",0,0,Red);}
}
{if(OrdersHistoryTotal()==0)
{lot=1;}
if(OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY))
{
if (OrderProfit()>0)
{
lot=1;
}
if (OrderProfit()<=0)
{
lot=OrderLots()*koeff; // Multiply by 2 after a losing trade
}
}
double zena1=Open[5];
double zena11=Open[4];
if (h==3 && m==00 && s==01 && zena1>zena11)
{
OrderSend(Symbol(), OP_BUY,lot,Ask,3,Bid-sl*Point,Ask+tp*Point,"",0,0,Green);}
if (h==14 && m==00 && s==01 && zena1<zena11)
{OrderSend(Symbol(), OP_SELL,lot,Bid,3,Ask+sl*Point,Bid-tp*Point,"",0,0,Red);}
}
}
return(0);
}
//+------------------------------------------------------------------+
Can you please tell me how to translate a character (string) into ASCII code?
Roughly speaking, you need the inverse of CharToStr().
Can you please tell me how to translate a character (string) into ASCII code?
Roughly speaking, you need the inverse of CharToStr().
Good afternoon.
help me need code
current chart
When a new bar opens, an order must be opened
Exactly the new bar
Good afternoon.
help me need code
current chart
When a new bar opens, an order must be opened
Exactly the new bar
No problem!
Start writing the code you need. In case of difficulties, ask questions and show pieces of the code you have written, and experienced comrades will show you where you went wrong.
Hi all.
I have a question. In the tester, the week starts at 00:00 if we look at the hour chart, for example. It is known that the forex week starts at 20:15 GMT. That is, in order to get from one hour in the tester hour GMT, roughly speaking, prebovlyayut 20 hours and divide modulo by 24, right?