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

 
Thanks, I've got it all figured out.
 

Oh, and such a question for the code:

for (shift=Nbars-Length-1;shift>=0;shift--)

{

smax[shift]=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_UPPER,shift);

smin[shift]=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_LOWER,shift);

if (Close[shift]>smax[shift+1]) trend=1;

if (Close[shift]<smin[shift+1]) trend=-1;


bsmax[shift]=smax[shift]+0.5*(MoneyRisk-1)*(smax[shift]-smin[shift]);

bsmin[shift]=smin[shift]-0.5*(MoneyRisk-1)*(smax[shift]-smin[shift]);

if (trend>0)

UpTrendBuffer[shift]=bsmin[shift];

else

DownTrendBuffer[shift]=bsmax[shift];

}

Why does it not start from the beginning of the chart? Let's say only the last 1000 bars.
 
Good afternoon all. Gentlemen, please help me to solve this problem...... I have the following message in the logs
[U]memory handler: cannot allocate 229450408 byte of memory[/U]
[U]HistoryBase: not enough memory 'EURUSD1'[5214774 bars][/U]
I rewrote history many times and cleaned logs both in the tester and in the terminal..... i've noticed the following thing: i downloaded the full quote and each timeframe separately, updated the chart on the screen, again on each timeframe and the chart is as it should be everywhere except 1M, which is where i work and test it. After i reboot the terminal i go to the history loading window, click on 1M and there is a 0/5214690 database on top and the window is empty...... put the owl to work .... I look at the logs after a while and there all normal, nothing too much, but if I open the window to load the histories, these messages are poured like crazy. Can this interfere with trade owl, can be the reason that the pump. base was on a day off and had such moments and how can I fix it. I hope I have described all the syndromes accessibly enough and would appreciate your help. Thank you!!!
 

Good afternoon!

This is my first time on this forum. Please don't judge me if I'm writing in the wrong place.

http://ruforum.mt5.com/threads/31263-simpleforextester-testirovanie-ruchnih-torgovih-sistem - here is a description of how to work with SimpleForexTester, but I have a problem: I have done everything as described, I have distributed files in folders correctly, ctrl+r - chose SimpleFXTester_v.2, adjusted period, launched... The chart "runs", but "SimpleForexTester" window does not open... Please advise what I am doing wrong. Screenshots attached.

After i rebooted the computer the message is displayed, i press "yes" - terminal closes...

Asked a question on the author's thread, but no one has answered there yet...

 

Hello.

I have this problem and a question for a pro.

The problem: There is a trend line indicator on the terminal that moves behind the price (something like a trailing stop). When I close and reopen the terminal it works fine, but when computer shuts down or turns off the light I get confused and does not save position of the trend line.

Question: How may I fix this problem? Maybe, there is a saving operator or the trend line value may be written somewhere programmatically.

Please advise. Thank you.

 

Here's a question. There are 2 indicators in one indicator. There are styles for each of them.

//---- indicator line

SetIndexBuffer(0,UpTrendBuffer);

SetIndexBuffer(1,DownTrendBuffer);

SetIndexStyle(0,DRAW_ARROW);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(0,159);

SetIndexArrow(1,159);

IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));


//---- indicators

SetIndexStyle(0, DRAW_ARROW, EMPTY, 1);

SetIndexArrow(0, 233);

SetIndexBuffer(0, CrossUp);

SetIndexStyle(1, DRAW_ARROW, EMPTY, 1);

SetIndexArrow(1, 234);

SetIndexBuffer(1, CrossDown);

GlobalVariableSet("AlertTime"+Symbol()+Period(),CurTime());

GlobalVariableSet("SignalType"+Symbol()+Period(),OP_SELLSTOP);

//----

Only one works, i.e. signals are issued with the same styling for both indicators. By the style, that was registered last. The question is how to divide the styles. That is, each indicator should have its own style.
 
alega:

Hello.

I have this problem and a question for a pro.

The problem: There is a trend line indicator on the terminal that moves behind the price (something like a trailing stop). When I close and reopen the terminal it works fine, but when computer shuts down or turns off the light I get confused and does not save position of the trend line.

Question: How may I fix this problem? Maybe, there is a saving operator or the trend line value may be written somewhere programmatically.

Please advise. Thank you.

It all depends solely on what and how it is written in the programme. We can't tell you anything by saying so.
 
Zolotai:

Here's a question. There are 2 indicators in one indicator. I have styles for each of them, only one of them works, i.e. signals are issued with the same design for both indicators. It works with the style, that is the last prescribed. The question is how to share the styles. I.e. we assign the style to each indicator.

There would be more buffers.

#property indicator_buffers 4
double UpTrendBuffer[],DownTrendBuffer[],CrossUp[],CrossDown[];
int init(){
//---- indicator line
 SetIndexBuffer(0,UpTrendBuffer);
 SetIndexStyle(0,DRAW_ARROW);
 SetIndexArrow(0,159);

 SetIndexBuffer(1,DownTrendBuffer);
 SetIndexStyle(1,DRAW_ARROW);
 SetIndexArrow(1,159);
 IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- indicators
 SetIndexBuffer(2, CrossUp);
 SetIndexStyle(2, DRAW_ARROW, EMPTY, 1);
 SetIndexArrow(2, 233);
 SetIndexBuffer(3, CrossDown);
 SetIndexStyle(3, DRAW_ARROW, EMPTY, 1);
 SetIndexArrow(3, 234);
 return(0);
}
int deinit(){return(0);}
int start(){
   int    counted_bars=IndicatorCounted();
//..................
   return(0);
  }
 
alega:

Hello.

I have this problem and a question for a pro.

The problem: There is a trend line indicator on the terminal that moves behind the price (something like a trailing stop). When I close and reopen the terminal it works fine, but when computer shuts down or turns off the light I get confused and does not save position of the trend line.

Question: How may I fix this problem? Maybe, there is a saving operator or the trend line value may be written somewhere programmatically.

Please advise. Thank you.

It all depends on the logic. If you set the trendline according to this logic: If there is no trendline with such and such name, then set it to such and such price value. Then the trend line will be set in any case. The main thing is for the Expert Advisor/indicator to be restarted after an emergency restart of the terminal.
 

Hello.
The OrderSelect function returns error 0 (ERR_NO_ERROR - Trade transaction was successful)??
How to avoid this error?
I am attaching the program code and journal entries.
Respectfully. Shurkin.

//+------------------------------------------------------------------+
//|                                                    PoligonTd.mq4 |
//|                                           17 сентября 2013 года. |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "17 сентября 2013 года."
#property link      ""

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----Функция OrderSelect--------------------------------------------+
string Str="#20552937 buy 1.00 GBPUSD at 1.55450";//Строка
int Tct=StrToDouble(StringSubstr(Str,1,9));//Номер ордера
   if(OrderSelect(Tct,SELECT_BY_TICKET)==true)//Выбор ордера по номеру
string OdSmb=OrderSymbol();//Символ ордера
   else Print("OrderSelect() вернул ошибку - ",GetLastError());
Print("Кс:"," Str=",Str,"; Tct ",Tct,"; OdSmb ",OdSmb,"?");//Кс
//----
   return(0);
  }
//+------------------------------------------------------------------+

2013.09.17 13:07:04 PoligonTd GBPUSD,Daily: removed
2013.09.17 13:07:04 PoligonTd GBPUSD,Daily: uninit reason 0
2013.09.17 13:07:04 PoligonTd GBPUSD,Daily: Ks: Str=#20552937 buy 1.00 GBPUSD at 1.55450; Tct 20552937; OdSmb ?
2013.09.17 13:07:04 PoligonTd GBPUSD,Daily: OrderSelect() returned error - 0
2013.09.17 13:07:04 PoligonTd GBPUSD,Daily: loaded successfully