Список форумов AmiSite.ru AmiSite.ru
Форум по Ами
 FAQ  •  Поиск  •  Пользователи  •  Группы   •  Регистрация  •  Профиль  •  Войти и проверить личные сообщения  •  Вход
 Ask how to write such indicators Следующая тема
Предыдущая тема
Начать новую тему  Ответить на тему
Автор Сообщение
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Вт Авг 13, 2013 9:05 am Ответить с цитатой Вернуться к началу

Kreangast писал(а):
Sorry, I did not clearly express ideas


if(H[i-1] > PA1[i-2]) {
PA1[i] = PA[i];
PS1[i] = PS[i];
}
else if(L[i-1] < PS1[i-2]) {
PS1[i] = PS[i]; // Same in previous condition. Why?
PA1[i] = PA[i]; // Same in previous condition. Why?
}
//If the above conditions are not met . Execute the following statement.
//If H [i]> Ref (H [i], -1]) <PA1,
//PS1 = H [i] -8 * TR;
//Because the highest point on the rise , PS1 also increased with change and I like this idea right
if(H[i] > Ref (H[i], -1)){ ; //
PS[i] =PS1[i] ; // in previous condition PS1[i] = PS[i]. So can not be
}
If L [i] <Ref(L[i],-1])> PS1,
PA1 = L [i] +8 * TR;
//Because the highest point on the decline , PA1 must change with the drop.
else if(Low[i] < Ref (L[i],-1)) {
PA[i] = PA[i]; //?????????????????????????????
}


Look at this schematic,
http://p13.freep.cn/p.aspx?u=v20_p13_photo_1308122216516235_0.jpg&click=1

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Вт Авг 13, 2013 10:07 am Ответить с цитатой Вернуться к началу

Kreangast писал(а):
Kreangast писал(а):
Sorry, I did not clearly express ideas


if(H[i-1] > PA1[i-2]) {
PA1[i] = PA[i];
PS1[i] = PS[i];
}
else if(L[i-1] < PS1[i-2]) {
PS1[i] = PS[i]; // Same in previous condition. Why?
PA1[i] = PA[i]; // Same in previous condition. Why?
}
//If the above conditions are not met . Execute the following statement.
//If H [i]> Ref (H [i], -1]) <PA1,
//PS1 = H [i] -8 * TR;
//Because the highest point on the rise , PS1 also increased with change and I like this idea right
if(H[i] > Ref (H[i], -1)){ ; //
PS[i] =PS1[i] ; // in previous condition PS1[i] = PS[i]. So can not be
}
If L [i] <Ref(L[i],-1])> PS1,
PA1 = L [i] +8 * TR;
//Because the highest point on the decline , PA1 must change with the drop.
else if(Low[i] < Ref (L[i],-1)) {
PA[i] = PA[i]; //?????????????????????????????
}


Look at this schematic,
http://p13.freep.cn/p.aspx?u=v20_p13_photo_1308122216516235_0.jpg&click=1

//
Very sorry , my thinking is the highest current value is greater than the previous high point and less than PA1, take the current PA1 values.
When the maximum value is greater than PA1 , the next BAR values ​​start to PA1 .

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Вт Авг 13, 2013 12:16 pm Ответить с цитатой Вернуться к началу

There will be two kinds of situations
First
if(H[i] > Ref (H[i], -1)){
PS[i] =PS1[i] ;
}
else {

if(Low[i] < Ref (L[i],-1)) {
PA[i] = PA[i];
}
}
//
The second case.
if(H[i-1] > PA1[i-2]) {
PA1[i] = PA[i];
PS1[i] = PS[i];
}
else if(L[i-1] < PS1[i-2]) {
PS1[i] = PS[i];
PA1[i] = PA[i];
}

Oleg to solve the problem, very grateful.
Better logic , would you please tell

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Вт Авг 13, 2013 4:09 pm Ответить с цитатой Вернуться к началу

SetBarsRequired(sbrAll, 0);
RESIG=True;
LLSIG=True;
HHSIG=True;

function HLMax(barHigh,barLow,BarClose){
a1=barHigh-barLow;
a2=abs((barHigh-BarClose));
a3=abs((barlow-BarClose));
maxValue=Max(Max(a1,a2),a3);
return maxValue;
}
for(i = 1; i < BarCount; i++) {

TDHH= High;
TDLL= Low;
YSCC=Ref(Close,-1);
//Re highest or lowest count(Computing the new position)
if ( RESIG==True) {

if (HHSIG==True) {
LL=4294967296;
}
if (LLSIG==True) {
HH= 0;
}
HHSIG= False;
LLSIG= False;
RESIG= False;
}

if (TDHH>= HH) {
HH=TDHH;
HC=HLMax(HH,TDHH,YSCC);
PS=HH-HC*8;
}

if (TDLL <= LL) {
LL= TDLL;
LC= HLMax(TDHH,LL ,YSCC);
PA= LL+HC*8;

}
//Trigger a re- count of the highest or lowest signal.
if ((TDLL<PS))OR (TDHH>PA)) {
RESIG = True;
if (TDHH > PA) {
HHSIG = True;
HH= TDHH;
HC=HLMax(HH,TDLL,YSCC);
PS=HH-HC*8;

}
if (TDLL < PS) {
LLSIG=True;
LL=TDLL;
LC=HLMax(TDHH,LL,YSCC );
PA=LL+LC*8;

}
}
PS1 = PS;
PA1 = PA;

Plot(C, "", colorBlack, styleCandle);
Plot( PS1 ,"PS1",colorRed,styleLine );
Plot( PA1 ,"PA1",colorBlue,styleLine );

This is my general idea statement with multiple error , please original cooler。
You can understand this idea , please help me finish him. . . Thank you very much

_________________
Beginner

Последний раз редактировалось: Kreangast (Вт Авг 13, 2013 4:34 pm), всего редактировалось 1 раз
Посмотреть профиль Отправить личное сообщение
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Ср Авг 14, 2013 2:28 pm Ответить с цитатой Вернуться к началу

Who can help me find a solution , please correct this idea , thank you very much。 Crying or Very sad

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
000
Site Admin


Зарегистрирован: 10.12.2007
Сообщения: 9106

СообщениеДобавлено: Чт Авг 15, 2013 12:10 am Ответить с цитатой Вернуться к началу

Question
Код:

SetBarsRequired(sbrAll, 0);
RESIG = True;
LLSIG = True;
HHSIG = True;

TDHH = High;
TDLL = Low;
YSCC = Ref(Close,-1);

function HLMax(barHigh,barLow,BarClose){
 a1 = barHigh-barLow;
 a2 = abs((barHigh-BarClose));
 a3 = abs((barlow-BarClose));
 maxValue = Max(Max(a1,a2),a3);
 return maxValue;
}

for(i = 1; i < BarCount; i++) {
 //Re highest or lowest count(Computing the new position)
 if( RESIG == True) {
  if (HHSIG == True) {
   LL = 4294967296;
  }
  if (LLSIG == True){
   HH = 0;
  }
  HHSIG = False;
  LLSIG = False;
  RESIG = False;
 }

 if (TDHH[i] >= HH) {
  HH = TDHH[i];
  HC = HLMax(HH, TDHH[i], YSCC[i]);
  PS = HH-HC*8;
 }
 if (TDLL[i] <= LL) {
  LL = TDLL[i];
  LC = HLMax(TDHH[i], LL, YSCC[i]);
  PA = LL+HC*8;
 }
 //Trigger a re- count of the highest or lowest signal.
 if (TDLL[i] < PS OR TDHH[i] > PA) {
  RESIG = True;
  if (TDHH[i] > PA) {
   HHSIG = True;
   HH = TDHH[i];
   HC = HLMax(HH, TDLL[i],YSCC[i]);
   PS = HH-HC*8;
  }
  if (TDLL[i] < PS) {
   LLSIG = True;
   LL = TDLL[i];
   LC = HLMax(TDHH[i], LL, YSCC[i]);
   PA = LL+LC*8;
  }
 }
 PS1[i] = PS;
 PA1[i] = PA; 
}


Plot(C, "", colorBlack, styleCandle);
Plot( PS1 ,"PS1",colorRed,styleLine );
Plot( PA1 ,"PA1",colorBlue,styleLine );

Question Question Question

_________________
ceterum censeo carthaginem esse delendam
Удачи. Олег.
Посмотреть профиль Отправить личное сообщение Посетить сайт автора
000
Site Admin


Зарегистрирован: 10.12.2007
Сообщения: 9106

СообщениеДобавлено: Чт Авг 15, 2013 12:10 am Ответить с цитатой Вернуться к началу

Question
Код:

SetBarsRequired(sbrAll, 0);
RESIG = True;
LLSIG = True;
HHSIG = True;

TDHH = High;
TDLL = Low;
YSCC = Ref(Close,-1);

function HLMax(barHigh,barLow,BarClose){
 a1 = barHigh-barLow;
 a2 = abs((barHigh-BarClose));
 a3 = abs((barlow-BarClose));
 maxValue = Max(Max(a1,a2),a3);
 return maxValue;
}

for(i = 1; i < BarCount; i++) {
 //Re highest or lowest count(Computing the new position)
 if( RESIG == True) {
  if (HHSIG == True) {
   LL = 4294967296;
  }
  if (LLSIG == True){
   HH = 0;
  }
  HHSIG = False;
  LLSIG = False;
  RESIG = False;
 }

 if (TDHH[i] >= HH) {
  HH = TDHH[i];
  HC = HLMax(HH, TDHH[i], YSCC[i]);
  PS = HH-HC*8;
 }
 if (TDLL[i] <= LL) {
  LL = TDLL[i];
  LC = HLMax(TDHH[i], LL, YSCC[i]);
  PA = LL+HC*8;
 }
 //Trigger a re- count of the highest or lowest signal.
 if (TDLL[i] < PS OR TDHH[i] > PA) {
  RESIG = True;
  if (TDHH[i] > PA) {
   HHSIG = True;
   HH = TDHH[i];
   HC = HLMax(HH, TDLL[i],YSCC[i]);
   PS = HH-HC*8;
  }
  if (TDLL[i] < PS) {
   LLSIG = True;
   LL = TDLL[i];
   LC = HLMax(TDHH[i], LL, YSCC[i]);
   PA = LL+LC*8;
  }
 }
 PS1[i] = PS;
 PA1[i] = PA; 
}


Plot(C, "", colorBlack, styleCandle);
Plot( PS1 ,"PS1",colorRed,styleLine );
Plot( PA1 ,"PA1",colorBlue,styleLine );

Question Question Question

_________________
ceterum censeo carthaginem esse delendam
Удачи. Олег.
Посмотреть профиль Отправить личное сообщение Посетить сайт автора
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Чт Авг 15, 2013 3:09 am Ответить с цитатой Вернуться к началу

Thank you very much , Oleg

And this does not work TimeFrameSet do not know why. Ask for help
SetBarsRequired(sbrAll, 0);
TimeFrameSet(in15Minute);
...
...
TimeFrameRestore();
_PA1[i]=TimeFrameExpand(PA,in15Minute);
_PS1[i]=TimeFrameExpand(PS,in15Minute);
Plot(_PA1,"pa1", colorRed, styleLine);
Plot(_PS1,"ps1", colorBlue, styleLine);

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
000
Site Admin


Зарегистрирован: 10.12.2007
Сообщения: 9106

СообщениеДобавлено: Пт Авг 16, 2013 12:28 am Ответить с цитатой Вернуться к началу

Код:

SetBarsRequired(sbrAll, 0);
RESIG = True;
LLSIG = True;
HHSIG = True;

function HLMax(barHigh, barLow, BarClose){
 a1 = barHigh-barLow;
 a2 = abs((barHigh-BarClose));
 a3 = abs((barlow-BarClose));
 maxValue = Max(Max(a1,a2),a3);
 return maxValue;
}

TimeFrameSet(in15Minute);

 TDHH = High;
 TDLL = Low;
 YSCC = Ref(Close,-1);


 for(i = BarCount - 1000; i < BarCount; i++) {
  //Re highest or lowest count(Computing the new position)
  if( RESIG == True) {
   if (HHSIG == True) {
    LL = 4294967296;
   }
   if (LLSIG == True){
    HH = 0;
   }
   HHSIG = False;
   LLSIG = False;
   RESIG = False;
  }

  if (TDHH[i] >= HH) {
   HH = TDHH[i];
   HC = HLMax(HH, TDHH[i], YSCC[i]);
   PS = HH-HC*8;
  }
  if (TDLL[i] <= LL) {
   LL = TDLL[i];
   LC = HLMax(TDHH[i], LL, YSCC[i]);
   PA = LL+HC*8;
  }
  //Trigger a re- count of the highest or lowest signal.
  if (TDLL[i] < PS OR TDHH[i] > PA) {
   RESIG = True;
   if (TDHH[i] > PA) {
    HHSIG = True;
    HH = TDHH[i];
    HC = HLMax(HH, TDLL[i],YSCC[i]);
    PS = HH-HC*8;
   }
   if (TDLL[i] < PS) {
    LLSIG = True;
    LL = TDLL[i];
    LC = HLMax(TDHH[i], LL, YSCC[i]);
    PA = LL+LC*8;
   }
  }
  PS1[i] = PS;
  PA1[i] = PA; 
 }

TimeFrameRestore();

PA1 = TimeFrameExpand(PA1,in15Minute);
PS1 = TimeFrameExpand(PS1,in15Minute);

Plot(C, "", colorBlack, styleCandle);
Plot( PS1 ,"PS1",colorRed,styleLine );
Plot( PA1 ,"PA1",colorBlue,styleLine );

_________________
ceterum censeo carthaginem esse delendam
Удачи. Олег.
Посмотреть профиль Отправить личное сообщение Посетить сайт автора
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Пт Авг 16, 2013 2:28 am Ответить с цитатой Вернуться к началу

Hi Oleg

for(i = BarCount - 1000;...
Ln:35,Col:13:Error 10.Array subscript out of range...

I think this idea, function is called how to write the time period
There is a better way , please tell me , thank you very much.

function PAPS( , )
{
...
}

TimeFrameSet(in15Minute);
PA1 = PAPS( , );
PS1=PAPS( , );
TimeFrameRestore();
_PA1= TimeFrameExpand(PA1,in15Minute);
_PS1=TimeFrameExpand(PS1,in15Minute);
Plot( _PS1 ,"PS1",colorRed,styleLine );
Plot( _PA1 ,"PA1",colorBlue,styleLine );

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
000
Site Admin


Зарегистрирован: 10.12.2007
Сообщения: 9106

СообщениеДобавлено: Пт Авг 16, 2013 7:15 am Ответить с цитатой Вернуться к началу

Kreangast писал(а):
Hi Oleg

for(i = BarCount - 1000;...
Ln:35,Col:13:Error 10.Array subscript out of range...

changed 1000 to 100...

_________________
ceterum censeo carthaginem esse delendam
Удачи. Олег.
Посмотреть профиль Отправить личное сообщение Посетить сайт автора
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Пт Авг 16, 2013 7:53 am Ответить с цитатой Вернуться к началу

000 писал(а):
Kreangast писал(а):
Hi Oleg

for(i = BarCount - 1000;...
Ln:35,Col:13:Error 10.Array subscript out of range...

changed 1000 to 100...


Hi Oleg

I still do not understand(i = BarCount - 1000...(100)...(10)),
If so how I want to write , thank you very much .
TimeFrameSet(in2*15Minute);
TimeFrameSet(in4*15Minute);
TimeFrameSet(in8*15Minute);

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
000
Site Admin


Зарегистрирован: 10.12.2007
Сообщения: 9106

СообщениеДобавлено: Пт Авг 16, 2013 9:35 am Ответить с цитатой Вернуться к началу

My English is very bad
You should try different numbers. Depends on the length of history in the database

_________________
ceterum censeo carthaginem esse delendam
Удачи. Олег.
Посмотреть профиль Отправить личное сообщение Посетить сайт автора
Kreangast



Зарегистрирован: 28.07.2013
Сообщения: 79

СообщениеДобавлено: Пт Авг 16, 2013 10:15 am Ответить с цитатой Вернуться к началу

000 писал(а):
My English is very bad
You should try different numbers. Depends on the length of history in the database


Thank you very much Oleg,I'll attempts data length.
First define a function , and then referenced okay.
So that I may make detours , please correct me , thank you.
function PAPS( , )
{
...
}

TimeFrameSet(in15Minute);
PA1 = PAPS( , );
PS1=PAPS( , );
TimeFrameRestore();

_________________
Beginner
Посмотреть профиль Отправить личное сообщение
000
Site Admin


Зарегистрирован: 10.12.2007
Сообщения: 9106

СообщениеДобавлено: Пт Авг 16, 2013 10:22 am Ответить с цитатой Вернуться к началу

I can't say. Perhaps in different cases differently

_________________
ceterum censeo carthaginem esse delendam
Удачи. Олег.
Посмотреть профиль Отправить личное сообщение Посетить сайт автора
Показать сообщения:      
Начать новую тему  Ответить на тему


 Перейти:   



Следующая тема
Предыдущая тема
Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах
Вы не можете вкладывать файлы
Вы не можете скачивать файлы


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme :: Часовой пояс: GMT + 3

File Attachment © by Meik Sievertsen