Closing of positions. On indicator signal. - page 7

 
Post a test on opening prices. I myself have this (from the beginning of this year): I am thinking about how to reduce pullbacks. My Expert Advisor is on demo, I have made 50% of deposit in a week (without MM). May be we can exchange the experience.
 

The expert works on all ticks. Not on opening prices at all. In the download - test for February 8

Files:
1111_1.zip  72 kb
 
I, for example, have a picture like yours by ticks in the tester, but when I test by bars, it is a bit different, much closer to reality (I compared it with demo). This is just my experience (I'm basically a beginner) and my observations. Maybe I'm fundamentally wrong, no denying that. I don't know if it's a coincidence or not, but here's my picture from the demo account: IMHO, very similar to yours :)
 

I haven't had time to record an inbox. And I don't have an inbox working on weekends. I don't quite understand. The testing should be performed in that mode, which is used in the Expert Advisor's code. If the algorithm implies working with all ticks, it is incorrect to test "by opening prices". You are only fooling yourself.

You need to understand why the results are different in different modes. At the same time "at opening prices" is a worse result. Usually the opposite is true.

Moreover, if the Expert Advisor works "at opening prices", the test result must coincide with the result of "at all ticks". Almost coincide.

 

It's all about the tester's tick generator. The conditions there are ideal. E.g. entry condition: a = 1.5001. In the tester it will be 100% true, but in reality it may not. The price can jump from 1.4999 to 1.5003 per 1 tick. The condition is missed, the trade was not opened. If I'm wrong - correct me, I would be grateful.

Here is my tick test:

Initial deposit 700.00



Net profit 6157.73

Maximum drawdown 74.80 (1.50%)

Opening prices:

Initial deposit 700.00



Net profit 1304.47

Maximum drawdown 514.82 (29.40%)
----

I have provided in my Expert Advisor the switching between ticks/bars. Of course, when enabling bar opening control, testing based on ticks and bars coincides. The picture is the same as the one drawn above by opening prices.

 
Lukyanov:

It's the tester's tick generator. Price can jump from 1.4999 to 1.5003 per tick. The condition was missed, the trade didn't open.

Yes, it is possible. Nevertheless. I think it is inadmissible to test an Expert Advisor that works with all ticks at opening prices. And we will obtain unreliable data on large timeframes. On the contrary, if this expert works at open prices, then testing "at all ticks" is possible and necessary.....

And there is a parameter for slippage - extern int Slippage=...;

 
Slippage is one thing, but the condition: open if a = 1.5000 is quite another...
 

Good afternoon everyone! This question may seem naive, but it's what got me into trouble...

I have an indicator that I want to use in my Expert Advisor. Here is the chart. Here is the code.

#property copyright "Copyright © 2006 , David W Honeywell , 12/12/2006"
#property link      "HellOnWheels.Trans@gmail.com"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red

#property indicator_maximum 100.0
#property indicator_minimum   0.0

#property indicator_level1 70
#property indicator_level2 50
#property indicator_level3 20

extern int IndicatorTime =  0;
extern int RSI_Periods   = 14;
extern int Applied_Price =  0;
extern int LineWidth     =  4;

double Buffer0[];
double Buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,LineWidth);
SetIndexBuffer(0,Buffer0);

SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,LineWidth);
SetIndexBuffer(1,Buffer1);

IndicatorShortName(" ColorRSI ( "+RSI_Periods+" )");

return(0);  
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
{
  
  int     counted_bars=IndicatorCounted();
  double  RSIValue;
  int     i;
  int     limit;

  limit = Bars-counted_bars;
  
  for(i=limit; i>0; i--)
   {
     RSIValue=iRSI(Symbol(),IndicatorTime,RSI_Periods,Applied_Price,i);
    if (RSIValue > 50.00000000)
     {
       Buffer0[i] = RSIValue;
       Buffer1[i] = EMPTY_VALUE;
       if (Buffer0[i+1] == EMPTY_VALUE) Buffer0[i+1] = Buffer1[i+1]; 
     }
    else
     {
       Buffer0[i] = EMPTY_VALUE; 
       Buffer1[i] = RSIValue;
       if (Buffer1[i+1] == EMPTY_VALUE) Buffer1[i+1] = Buffer0[i+1]; 
     }
   }

//---- done
  
  return(0);
}

 

I can't figure out how to set the condition for changing from red to green and vice versa!

And how do I set the i Custom expression to implement this transition... Please answer if you know...

 
if ( Buffer0[i+1] != EMPTY_VALUE && Buffer0[i+2] == EMPTY_VALUE )
{
  // началась зеленая линия
}
It's more or less like this
Reason: