[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 384

 
aero >>:

1. почему нe знаю, но можно попробовать перед импортом удалить все содержимое папки history

Yes, I deleted the whole story.

 

Help me fix the indicator. You need to be able to change the properties of the arrows and the cross in the indicator object edit box.


Files:
 

Good afternoon, friends.


Can you please tell me how to use the iCustom function correctly?


For example, you have an indicator

"Williams' Accumulation/Distribution, W A/D - Larry Williams' Accumulation/Distribution"(https://www.mql5.com/ru/code/7064)


and I want to access this indicator from another indicator using iCustom function:

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

extern string Symbol1="USDJPY";
extern int SignalMA_Period=5;
extern int SignalMA_Method=0;

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
string short_name="ind";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
SetIndexLabel(1,"Signal");
SetIndexDrawBegin(1,SignalMA_Period);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
double ad1, ad2;
//----
if(counted_bars<0) return(-1);
//----
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
//----
for(int i=0; i<limit; i++)
{

ad1=iCustom(Symbol1,0,"WAD",1,i);

ExtMapBuffer1[i]=ad1;
}
//----
for(i=0; i<limit; i++)
ExtMapBuffer2[i]=iMAOnArray(ExtMapBuffer1,Bars,SignalMA_Period,0,SignalMA_Method,i);
//----
return(0);
}
//+------------------------------------------------------------------+


The Williams indicator in my system is named WAD.

But, unfortunately, it displays an empty window with the indicator (i.e., there is no indicator in the window... it is not built)


How to fix it, please advise, if possible.

Thank you very much in advance.

 
Morzh09 писал(а) >>

Good afternoon, friends.

Could you please advise how to use iCustom function correctly?

For example, there is an indicator

"Williams' Accumulation/Distribution, W A/D - Larry Williams' Accumulation/Distribution"(https://www.mql5.com/ru/code/7064)


I want to apply to this indicator from another indicator using iCustom function:


ad1=iCustom(Symbol1,0,"WAD",1,i);


The Williams indicator in my system is named WAD.

But, unfortunately, it displays an empty window with the indicator (i.e., there is no indicator in the window... it is not built)

How to fix it, please advise, if possible.

Many thanks in advance.

Apparently you are addressing the wrong buffer. You may need 0. I have a good idea of what to do with it.

 

Yes. You have to treat it differently

ad1=iCustom(Symbol1,0,"WAD",0,i); 
 

I've come across this feature:

we open the meta-editor,

change values of external variables in the source,

compile,

we open the terminal - the same Expert Advisor is already on the chart, but it is run with old values of external variables!

If you compile when the EA is running - the values will be updated.

The problem can be solved by #define and reassignment in the initialization, but this is a bit messy...

The terminal stores old values of EA's external variables, but I have not found it.

what does this mean and how do i cope with it?

 
beruk >>:

сталкнулся с такой особенностью:

открываем метаэдитор,

меняем в исходнике значения внешних переменных,

компилируем,

открываем терминал - на графике уже висит этот-же советник, но запускается он со старыми значениями внешних переменных!

если откомпилировать при запущенном советнике - значения обновятся.

проблему можно решить через #define и переназначение в инициализации, но это как-то коряво...

видимо терминал хранит где-то старые значения внешних переменных советника, но я не нашол.

шо сие означает и как с этим бороться?


the values are stored in a chart file with chr in the profiles/(selected profile) folder
 
xeon писал(а) >>

the values are stored in a chart file with chr in the folder profiles/(selected profile)

right!

but I guess there's nothing you can do about it, and reassigning via #define is the best thing to do, if necessary?

 

Can you advise me on this question, please?


I want to use American and European bond quotes for trading analysis, but my broker does not provide them...


In such situation, as far as I understand, there are two possible ways:


1. Change broker

2. import quotes from external source into Metatrader platform.


There are 2 questions in this regard:


I. Where can I download quotes from:


1) US 10 Yr T-Note

2) Euro Bund


And how to import them into the Metatrader platform?


II. Which broker will trade these instruments?

(For the second question, please send it to my personal message, not to be considered as a promotion)


Thank you very much in advance.
 

What is wrong here?

I attach this EA to hourly chart and if the price at the beginning of the hour is higher than cn1 and the current price is 8 points above it, the order should open (also if the price is below the current level), but my EA opens position immediately for some reason. Why?

  int i=0;
   double a,b;
   while (i==0)
   {
     a=MarketInfo("USDCAD", MODE_ASK);
     b=MarketInfo("USDCAD", MODE_BID); 
     if((Open[0]<cn1)&&((a-cn1)<0.0008))
      {
       OrderSend("USDCAD",OP_BUY,1,a,1,SL,cn2);
       i=1;
       }
     if((Open[0]>cn11)&&((cn11-b)<0.0008))
      {
       OrderSend("USDCAD",OP_SELL,1,b,1,SL1,cn21);
       i=1;
      }  
   }