Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 321

 
tara:

You're shitting me.

Yeah. On the bike...


 
Don't repeat yourself.
 
tara:
Don't repeat yourself.

Shit, that's right...


 
borilunad:
Who knows? How to program the spread that we put in the tester, as I check with different values? I get it on Real or Demo, from MarketInfo()! And how do I do it in the Strategy Tester?

Thank you, Owner! Why did you put the text in the SRC?! You're stretching my text so you can't catch "reply"! That's why I'm replying here. I got jammed that MarketInfo() doesn't work in tester, that's why I stalled. Of course, if I set spread in tester, I can get it from Aska-Bid difference, which I'll correct in my own code now! Tried it, it doesn't work! We only know the Bid, but how do we know the spread and Ask? Like the chicken and egg case before?

Why should we normalize MARKETINFO, as well as CLOSE, OPEN, Ask and Bid? It is already normalized anyway. Or can't you spoil mush with butter? In the tester, you set the spread close to the maximum in the real market and test it on the most unfavorable conditions. In the tester, Ask=Bid+the specified spread.
 
artmedia70:

Screwdriver, spanner, corkscrew, knife, fork...

What are we wrenching?


I need to open an order 20 five-minute bars after the current bar.

If I track the 20th bar by the time a candle opens, in some cases bar 20 may be 19,18 .... as some candles may occasionally be missing.

How to code the order to open at the opening of bar 20(30....) after the current bar.

Thank you.

 

Who knows how to disable swap accrual in the tester?

 
_new-rena:

Who knows how to disable swap accrual in the tester?


Uh.... and I don't even have it on.......... Without swap, testing is going on......If you think about it, swap, it's to a specific DC, and how can the tester get attached to that?
 
Sepulca:

Uh.... and I don't even have it on.......... Without swap, testing is going on......If you think about it, swap, it's to a specific DC, and how can the tester get attached to that?

Here

Still - how do you turn off swap accrual in a meta.

Who knows?

 
Sepulca:
Why normalise MARKETINFO and also CLOSE, OPEN, Ask and Bid? It is already normalized. Or can't you spoil your mush with butter? In the tester, you set the spread close to the maximum in the real market and test it on the most unfavorable conditions. In the tester, Ask=Bid+the specified spread.
I understand it! But how do I program this variable (the "specified spread")? Of course, I can create a variable Spread and change it every time I change the spread in the tester. Say, Spread(TestGenerator) or there's some function, or you can somehow make such a function, it can't be that you can't! А?
 

Can you tell me how to make the indicator displays not the current but the maximum value of the last Per bars, I used Osma as an example, but it shows current in the Strategy Tester when the chart is moving and when you just put it on the chart, nothing:

//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 1
#property   indicator_color1  Silver
#property   indicator_width1  2
//---- indicator parameters

extern int Per=12;
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- indicator buffers
double     OsmaBuffer1[];
double     OsmaBuffer[];
double     MacdBuffer[];
double     SignalBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(4);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(Digits+2);
//---- 3 indicator buffers mapping
   SetIndexBuffer(0,OsmaBuffer1);
   SetIndexBuffer(1,OsmaBuffer);
   SetIndexBuffer(2,MacdBuffer);
   SetIndexBuffer(3,SignalBuffer);
   
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Average of Oscillator                                     |
//+------------------------------------------------------------------+
int start()
  {
   
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- macd counted in the 1-st additional buffer
   for(int i=0; i<limit; i++)
      MacdBuffer[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd additional buffer
   for(i=0; i<limit; i++)
      SignalBuffer[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
//---- main loop
   for(i=0; i<limit; i++)
      OsmaBuffer[i]=MacdBuffer[i]-SignalBuffer[i];
//---- done
   for(i=0; i<limit; i++)
    {
     for(int b=0; b<Per; b++)
      {
       OsmaBuffer1[i] =OsmaBuffer[ ArrayMaximum(OsmaBuffer,Per,b)];
      }
    } 
  return(0);
  }
Всё разобрался, перемудрил просто))), достаточно этого:
for(i=0; i<limit; i++)
    {
     OsmaBuffer1[i] = OsmaBuffer[ ArrayMaximum(OsmaBuffer,Per,i)];
    }