[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 224

 
Dmido >> :

Add a new bar control function to the code. Then only one position will be opened within one candle. At the same time in the condition of the opening specify New_Bar()==true.

bool New_Bar()
  {
   static int PrevTime =0;
   if( PrevTime==iTime(NULL,0,0)) return(false);
   PrevTime=iTime(NULL,0,0);     return(true);
  }
 

Gentlemen Experts. Looking for some old EA to open two Limit/Stop orders from Open to both sides at a distance of N (like Straddle) every hour (day) to experiment.

Nothing comes to mind?

 
Hi. Question: is there an indicator that shows the speed (acceleration) of a pair's price? The purpose is to aid in trading on the news. Is there anything similar?
 
Rucobor >> :
Hi. Question: is there an indicator that shows the speed (acceleration) of a pair price? The purpose is to help me to trade on the news. Is there something like this?
Read old Billy... his indicators measure both speed and acceleration...
 

There is a trend line drawn from several points on the history (green). We need to extend its projection (red in the photo):




Using the green one, we calculate the "k" coefficient for y=k*x .

Then let's take 20 bars and using the known "k" and time (Period * 20 * 60) calculate the "y" point.

Then using the time for the 20th bar and the obtained "y" we draw a trend line.

- This will work until we have some missed bars (weekend or holidays) or whatever.

As a result, the actual time of the 20th bar shown will be greater and the slope will be wrong.

- Is there any simple solution?





 
Alex5757000 писал(а) >>

Add a new bar control function to the code. Then only one position will be opened within one candle. At the same time specify New_Bar()==true in the condition to open

https://www.mql5.com/en/market/mt4/expert

 
forex-k >> :


how easy is it to determine the crossing point between the price and the trend line? without 3D arrays.

I finally got what I wanted and without complex arrays for H1

//+------------------------------------------------------------------+
int start()
{
if(ObjectGet("TREND",OBJ_TREND)==0)
{
ObjectCreate("TREND",OBJ_TREND, 0,TimeCurrent()-60*60*100,Bid-50*Point,TimeCurrent(),Bid+50*Point);
ObjectSet("TREND",OBJPROP_COLOR,Aquamarine);
}
double cdelta=ObjectGet("TREND",OBJPROP_PRICE2)-ObjectGet("TREND",OBJPROP_PRICE1);
double tdelta=((ObjectGet("TREND",OBJPROP_TIME2)-ObjectGet("TREND",OBJPROP_TIME1))/60)/60;
if(TimeHour(ObjectGet("TREND",OBJPROP_TIME2))!=Hour())
ObjectMove("TREND",1,TimeCurrent(),(ObjectGet("TREND",OBJPROP_PRICE2)+cdelta/tdelta));
}
//+------------------------------------------------------------------+

 

forex-k писал(а) >>



 
forex-k >> :




and now the intersection condition remains to be written

int digits=MarketInfo(Symbol(),MODE_DIGITS);
if(NormalizeDouble(Bid,digits-2)==NormalizeDouble(ObjectGet("TREND",OBJPROP_PRICE2),digits-2))

{
PlaySound("Wait.wav");

Sleep(1000);

}

Files:
 
chief2000 >> :


As a result, the actual time of the 20th bar displayed will be longer and the slope will be incorrect.



Is there a guarantee that there were no missed bars when the green line was drawn? If there is no such a guarantee, the question about correctness-falseness of the slope disappears by itself because it makes no sense...