[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 153

 
Skydiver:
I have a question. If for example a series of BUY trades has a profit factor -1.01, then it would be better to open a series of SELL trades with parameters reversed. If for a Buy position take was 200 points stop 100, then for a Sell position take 100 and stop 200? Am I thinking correctly?

Why don't you check it yourself? Why don't you check it yourself? And we'd share the results too...
 
Roman.:

Why not check it yourself with an owl? And share the results, too...

I'm in the middle of it now. :-) really don't know if I'll make it today (tired)
 
Skydiver:

I'm in the middle of it. :-) really don't know if I'll make it today (tired).

IMHO, you don't need to hurry in this business... The main thing is quality and absence of mistakes in calculations, also pay attention to spread value in the first and in the second case, so that change of its value was minimal...
 
alex12:
Maybe instead of logical && you should write || (logical OR) ?

It's all wrong, think about it, you want to prescribe (or ), so the price is always, either above... or below... level.

Try searching on the forum, somewhere it was discussed " level breakdown " .

 

Good day to all.

I have decided to try to write an indicator, but I have faced a problem. It starts drawing only from the moment I put it on the chart.

How to make it calculate at least some part of the history?

int start()
  {
   int    counted_bars=IndicatorCounted();
   int i;
//----
   i=Bars-counted_bars-1;

   while(i>=1)                      
     {
     double Max=High[iHighest(NULL,0,MODE_HIGH,Nbar,0)];
     double Min=Low[iLowest(NULL,0,MODE_LOW,Nbar,0)];
       Buf[i]=Max-((Max-Min)/2);
       ABuf[i]=iMAOnArray(Buf,0,Per,0,MODE_SMA,i);             
      i--;                          
     }
//----
   return(0);
  }
Maybe someone can explain to an inexperienced person how to write it correctly?
 

Gek34:

I decided to try writing an indicator, but encountered a problem. It starts drawing only from the moment it is thrown on the chart...

Put it in a separate loop. The array for iMAOnArray has no time to be formed.
ABuf[i]=iMAOnArray(Buf,0,Per,0,MODE_SMA,i);   
 

It's not working, I've stopped drawing altogether.

Would you be so kind as to give me a lesson and example for the future?

Sincerely Gek.

 
Gek34:

It's not working, I've stopped drawing altogether.

Would you be so kind as to give me a lesson and example for the future?

Sincerely Gek.


I guess so:
int start()
  {
   int    counted_bars=IndicatorCounted();
   int i;
//----

   double Max=High[iHighest(NULL,0,MODE_HIGH,Nbar,0)];
   double Min=Low[iLowest(NULL,0,MODE_LOW,Nbar,0)];

   i=Bars-counted_bars-1;
   while(i>=1)                      
     {
       Buf[i]=Max-((Max-Min)/2);
      i--;                          
     }


   i=Bars-counted_bars-1;
   while(i>=1)                      
     {
       ABuf[i]=iMAOnArray(Buf,0,Per,0,MODE_SMA,i);             
      i--;                          
     }
//----
   return(0);
  }
 
PapaYozh:

I guess so:

Heee.... I think it should all be in a loop, like this:

 while(i>=1)                      
     {
     double Max=High[iHighest(NULL,0,MODE_HIGH,Nbar,i)];
     double Min=Low[iLowest(NULL,0,MODE_LOW,Nbar,i)];
       Buf[i]=Max-((Max-Min)/2);
       ABuf[i]=iMAOnArray(Buf,0,Per,0,MODE_SMA,i);             
      i--;                          
     }
 
r772ra:

Heee.... I think it all has to be in a cycle, like this:


Thank you so much. It all worked, I saw my mistake straight away.

And indeed they say, the world is not without good men.

Reason: