[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 580

 
alsu:
Then I can only advise one thing - put Prints in all the potentially problematic places, and give us the logs of the non-trading EA. Unless, of course, you can figure out the prints yourself.


There was a problem with the stops, I fixed it)

I'd still like to thank you very much for replying to my request).

 

 
it worked )-the site is not loading well.
 
LeRus:

Good evening.

I can't find anywhere how to programmatically overlay the Bollinger Bands indicator on another indicator /not on a price chart/ and then find out the upper and lower band values.

I would be very grateful if someone could suggest it.



Show me how you apply it with your hands
 

Ivn:

Why does a trade open?

Display all flags on the chart with Comment` and you will see why the trade opens.
 
kellin:
Thank you for the work you have done. I will study it in practice, for me it is important that the opening price of the order coincides exactly with the price of a new bar. I will write what is obtained in reality.

Ok.
 
LeRus:

Good evening.

1. Nowhere can I find how to programmatically overlay the Bollinger Bands indicator on another indicator /not on the price chart/ .

2. And then find out the values of the upper and lower bands.

I would be very grateful if someone could suggest it.



Good.
1. To help. + trailer parsing: owl Bunds by RSI and trawl by parabolic.

2.

   double op,sl,tp;
   double rsi[101]; 
   double irsi;  
   double fractal;
   ArraySetAsSeries(rsi,true);
   for(int i=100; i>=0; i--)  
   {
   rsi[i]=iRSI(NULL,0,rsiperiod,PRICE_CLOSE,i);
   if(i==1){irsi=rsi[i];}
   }
   
   double bbup=iBandsOnArray(rsi,0,bbperiod,bbotcl,0,MODE_UPPER,1);
   double bblow=iBandsOnArray(rsi,0,bbperiod,bbotcl,0,MODE_LOWER,1); 
   

double bbup=iBandsOnArray(rsi,0,bbperiod,bbotcl,0,MODE_UPPER,1);
double bblow=iBandsOnArray(rsi,0,bbperiod,bbotcl,0,MODE_LOWER,1); 
 
 for (int i=1; i<=OrdersTotal(); i++)       
     {                                      
      if(OrderSelect(i-1,SELECT_BY_POS, MODE_HISTORY)==true)
        {                                     
         RAZ=OrderOpenPrice()-OrderClosePrice();
         Sum=sum+RAZ;
        }
          Print("Sum =" sum);
     }          
When testing a CFD advisor, problems arise, the results in the tester do not correspond to reality.... can we insert a function in the advisor that would calculate the profit itself, i.e. analyse all orders in the history (in fact, calculate the difference between opening an order and closing it) and summarise it??????

did i do it right or not?
 
Vovo4ka:
When testing an EA for CFD, there are problems with results not corresponding to reality.... can we use a function in the EA, which would calculate profit by itself, i.e. analyse all orders in the history (actually, calculate the difference between order opening and its closing) and summarise??????

did i do it right or not?


Almost:

 for (int i=0; i<OrdersTotal(); i++)       
     {                                      
      if(OrderSelect(i,SELECT_BY_POS, MODE_HISTORY)==true)
// Можно вставить ещё if(OrderSymbol()==ВашСимвол} и if(OrderOpenTime()>=ДатаНачалаПодсчётаПрибыли )   
        {                                     
         Sum+=OrderProfit();  //OrderOpenPrice()-OrderClosePrice();
        }
     } 
  Print("Sum =" sum);
 

But keep in mind that when testing on different timeframes, different methods (all ticks or by opening for example) and even during optimization and just running the profit may be different.

 
Sepulca:


Almost:

But note that when testing on different timeframes, different methods (all ticks or by opening for example) and even when optimising and just running the profits may be different.


Somehow the profit is taken, not the one that should be..... when the lot is closed, on the contrary, when the profit should be 30pp in profit it is written completely different....
Reason: