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

 
remobal писал(а) >>

What is so funny about it, please explain?

All you have to do is read some popular literature and the question goes away. Your question means you want everything on a silver platter.

 
Vinin >>:

Достаточно почитать популярную литературу и вопрос сам собой закроется. Ваш вопрос означает что Вам нужно все подать на блюдечке с голубой каемочкой.

Excuse me, please, I read popular literature, but unfortunately I haven't found the answer to this question there either.

Would you mind giving at least the title of the book and the name of the author.

Thank you very much in advance!

 
Good afternoon, could you tell me if I needthe Awesome Oscillator in a scoop, its parameters are constant and it doesn't need to be prescribed as a MA?
 
Should it be declared and where should it be written? And how should it be referred to in the EA? As AO or Awesome Oscillator?
 
Farina >>:
Нужно ли его объявлять и в каком месте прописывать? и как на него ссылаться в советнике? как AO или Awesome Oscillator ?
double iAO( string symbol, int timeframe, int shift)
Calculation of Awesome oscillator.
Parameters:
symbol - Symbol name of symbol, on data of which the indicator will be calculated. NULL means current symbol.
timeframe - Period. Can be one of the periods of the chart. 0 means the period of the current chart.
shift - Index of the value obtained from the indicator buffer (shift relative to the current bar by the specified number of periods back).
Example:
 double val=iAO(NULL, 0, 2);
 
thanks)
 

Good afternoon friends.

Confused in the code, please advise what needs to be corrected.


I have found LeManTrend indicator on this forum.

I want to modify it a bit - add smoothing moving averages on two lines in indicator.

I prepare arrays ma[] and ma2[] for this purpose.


But when I add this indicator to the chart, "nothing is drawn"...

what is the problem?


//----

string Indicator_Name = "ind1";

int Objs = 0;

//----

#property indicator_separate_window

#property indicator_buffers 4

//----

int Bars.Count = 0;


extern int Min = 13;

extern int Midle = 21;

extern int Max = 34;

extern int PeriodEMA = 3;

//---- Буферы

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double TempBuffer1[];

double TempBuffer2[];

double ma[];

double ma2[];

int method_ma = 0;


//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

IndicatorShortName(Indicator_Name);

int cur = 0;

int st = 23;

//-------------------------------------------

int width = 2;


SetIndexStyle(0, DRAW_LINE, DRAW_LINE, width, Yellow);

SetIndexBuffer(0, ExtMapBuffer1);

SetIndexStyle(1, DRAW_LINE, DRAW_LINE, 2, Blue);

SetIndexBuffer(1, ExtMapBuffer2);

SetIndexBuffer(2, ma);

SetIndexStyle(2, DRAW_LINE, DRAW_LINE, 1, Red);

SetIndexBuffer(3, ma2);

SetIndexStyle(3, DRAW_LINE, DRAW_LINE, 1, Teal);

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----


//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{


int limit;

if (IndicatorCounted()<0) return(-1);

limit=Bars-IndicatorCounted();

if (Bars.Count>0 && limit>Bars.Count)

limit=Bars.Count;

int i = limit;

//----

while(i >= 0)

{

double High1 = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, Min,i+1));

double High2 = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, Midle,i+1));

double High3 = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, Max,i+1));

TempBuffer1[i] = ((High[i]-High1)+(High[i]-High2)+(High[i]-High3));

double Low1 = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, Min, i+1));

double Low2 = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, Midle, i+1));

double Low3 = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, Max, i+1));

TempBuffer2[i] = ((Low1-Low[i])+(Low2-Low[i])+(Low3-Low[i]));

i--;

}

//---- основной цикл

for( i = 0; i < limit; i++)

{

if (PeriodEMA > 0 )

{

ExtMapBuffer1[i] = -iMAOnArray(TempBuffer1,Bars,PeriodEMA,0,MODE_EMA,i);

ExtMapBuffer2[i] = -iMAOnArray(TempBuffer2,Bars,PeriodEMA,0,MODE_EMA,i);

}

else

{

ExtMapBuffer1[i] = TempBuffer1[i];

ExtMapBuffer2[i] = TempBuffer2[i];

}

}


//====================================================================


//--------------------------------------------------------------------


//элементы скользящих средних

for(i = 0; i < limit; i++)

{

ma[i]=iMAOnArray(ExtMapBuffer1,0,8,0,method_ma,i);

ma2[i]=iMAOnArray(ExtMapBuffer2,0,8,0,method_ma,i);

}


//====================================================================

//----

return(0);

}




Attached is the original LeManTrend indicator


Files:
 

Guys, why does it give a close error, and on two different terminals...

: OrderClose error 4107

: invalid price 1.48566000 for OrderClose function

All three variants give the same error: which of them is more correct?

OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3, Violet);
OrderClose(OrderTicket(),OrderLots(),MarketInfo(Symbol(),MODE_BID),3,Violet);

 
T-G писал(а) >>

Guys, why does it give a close error, and on two different terminals...

: OrderClose error 4107

: invalid price 1.48566000 for OrderClose function

By the way, which of the three options is the right one?

I guess I have to pre-select the order.

 
T-G >>:

Ребята, ну почему дает ошибку закрытия, при чем на двух разных терминалах..

: OrderClose error 4107

: invalid price 1.48566000 for OrderClose function

причем дают одинаковую ошибку все три варианта: и кстати какой из них наиболее правильный?

Is the order pre-selected? Because all these functions "OrderTicket(),OrderLots(),OrderClosePrice()" only work when the order is selected by OrderSelect().