[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 189
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
Thank you, the window has appeared. Now I'll know.
And another question.
How to make for (i=1; i<StartBar; i++) StartBar to be the bar with the specified bend (extern int b= 2)of the older timeframe (extern int = ... ; //W1, MN1)
Find the bar time and recalculate it to the bar number of the senior TF
Why don't you write the code?
How to make for (i=1; i<StartBar; i++) StartBar to be the bar with the specified bend (extern int b= 2) of the older timeframe (extern int = ... ; //W1, MN1)
Correction
Matching two tops of a specified timeframe (let's say weekly and monthly)
Is this the right way to go about it?
Condition tf1 >tf2
The question is as follows. In MQL4book , which can be found at MQL4.community , in "GlobalVariables" chapter in "Properties of GV-Variables" section it says: "GV variables can only have type double". Below, in the "GlobalVariableDel() Function" section, there is an example of expert globalvar.mq4 with the following content:
Question: why in this example the GV variables Expert and New_Expert are of int type , although, as stated earlier, these variables should be ofdouble type ?
Thank you in advance for the answer
Is this the right way to do it?
Condition tf1 >tf2
Something is wrong.
In the first cycle I try to find the price of the specified bend on the high TF. I start the second cycle on the low TF where I look for the price of each bend on the bars as long as it is on the chart and compare it with the price found in the first cycle. If I find such a price, I return the time of the bar of the given bend in this TF.
I started it from 2000.01.01 in the tester.
What is in the log
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.1688
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.2495
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.1192
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.2315
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.1069
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.3161
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.2351
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.4535
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.338
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.4249
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.3
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.416
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.2596
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.3353
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.2658
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.3138
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.0344
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.1537
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.0608
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.1216
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.079
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.2401
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.0104
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 1.0917
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 0.8227
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p2= 0.9596
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: t1 1992.09.01 00:00
2012.06.17 10:29:39 2001.07.06 03:30 zz_date v3 EURUSD,M15: p1 1.4104
The same was in 2000, i.e. in the beginning of the testing period.
Where is the error. I am a weak programmer. I want to write a test program. I am having a hard time with it. I cannot ask the programmer to do it, because it is being done in steps, depending on the data I have received.
I need some help here. I also asked for help on previous page to write NewZZ() function.
I will be grateful, if somebody will correct errors and explain them.
Something is wrong.
Help the weak.
Good afternoon. Found a trailing function on the website:
for(i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) continue;
if(OrderType()==OP_BUY)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop_)
{
{ if(OrderStopLoss()<Bid-Point*TrailingStop_)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop_,OrderTakeProfit(),0,Green);
return(0);
}
}
}
if(OrderType()==OP_SELL)
{
if((OrderOpenPrice()-Ask)>(Point*TrailingStop_))
{
if((OrderStopLoss()>(Ask+Point*TrailingStop_)) || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop_,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
When testing the strategy, after the first order opens, this function works fine, i.e. trailing runs and the order closes. But after opening the second order, a zero divide error occurs when referring to the trailing function. Please help me to get trailing function working for the second order, the third order, etc.