Список форумов AmiSite.ru AmiSite.ru
Форум по Ами
 FAQ  •  Поиск  •  Пользователи  •  Группы   •  Регистрация  •  Профиль  •  Войти и проверить личные сообщения  •  Вход
 Array size of each candle/bar in amibroker ? with working C Следующая тема
Предыдущая тема
Начать новую тему  Ответить на тему
Автор Сообщение
fxtrz



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

СообщениеДобавлено: Пт Окт 28, 2016 8:49 pm Ответить с цитатой Вернуться к началу

Hello,
I'm new here .. Thanks to all
As you might know, amibroker is similar to C .. that's what I've been told ..


Below code need to get correct:
Код:

SetBarsRequired(-2,-2);
Plot( C, ""+Interval(2), styleCandle );
for( i = 1; i <4 ; i++ )
{
   TimeFrameSet(i*in1Minute );
   rs = RSI(14);
   TimeFrameRestore();
   VarSet( "M"+ i, TimeFrameExpand( rs, i*in1Minute , expandPoint ) );
M = VarGet( "M" + i );

   for( b = 0; b < BarCount; b++ )
    {
if(M[b] )   PlotText(" "+(i), b, L[b]-1-(i), colorAqua);
}
}
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );SetBarsRequired(-2,-2);


/*
shape2 = 0;
shape3 = 0;
for( b = 0; b < BarCount; b++) {// visible chart area loop
 
getvar = ....;
    switch( getvar  ) {
        case 2: ....
 
        case 3: ....

            default: break;
    }                 
}     

PlotShapes( shape2 * shapeSmallCircle, colorWhite, 0, L, n*-35 );
PlotShapes( shape3 * shapeSmallCircle, colorYellow, 0, L, n*-35 );


NEED OUTPUT LIKE PICTURE..

3x means 3 times ..
2x means 2 times ..
Yes , i haven't written all 2x and 3x ..

What do i need to add to make it work like upper picture?

I need to count numbers under the candle?

Thank youImage
(sorry , i don't know how to post image small )
Посмотреть профиль Отправить личное сообщение
000
Site Admin


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

СообщениеДобавлено: Пт Окт 28, 2016 10:15 pm Ответить с цитатой Вернуться к началу

Код:

getvar = ...; // getvar[i] = 1 or 2 or 3

for( i = 1; i < 4 ; i++ )
{
   for( b = 0; b < BarCount; b++ )
   {
      if( getvar >= i )   
         PlotText( " "+(i), b, L[b]-(i), colorBlack);
   }
}

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



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

СообщениеДобавлено: Сб Окт 29, 2016 8:38 am Ответить с цитатой Вернуться к началу

Image
Image

Пожалуйста, проверьте, если код работает или нет ..
Kindly, check it if code is working or not ..
Посмотреть профиль Отправить личное сообщение
000
Site Admin


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

СообщениеДобавлено: Сб Окт 29, 2016 8:50 am Ответить с цитатой Вернуться к началу

Код:

SetBarsRequired(-2,-2);
Plot( C, ""+Interval(2), styleCandle );
N = 0;
for( i = 1; i <4 ; i++ )
{
   TimeFrameSet(i*in1Minute );
   rs = RSI(14);
   TimeFrameRestore();
   VarSet( "M"+ i, TimeFrameExpand( rs, i*in1Minute , expandPoint ) );
   M = VarGet( "M" + i );

   for( b = 0; b < BarCount; b++ )
   {
      if( M[b] ) N[b]++;  //PlotText(" "+(i), b, L[b]-1-(i), colorAqua);
   }
}
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
for( b = 0; b < BarCount; b++ )
{
   PlotText( NumToStr(N[b], 1.0), b, L[b] - 1, colorRed);
}


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



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

СообщениеДобавлено: Сб Окт 29, 2016 10:59 am Ответить с цитатой Вернуться к началу

спасибо Thx

Image

we will use this for further calculation
мы будем использовать это для дальнейшего расчета

Cann we write in a way, it can be used for further calculation?
мы можем писать так,его можно использовать следующий расчет
Посмотреть профиль Отправить личное сообщение
fxtrz



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

СообщениеДобавлено: Вс Окт 30, 2016 1:15 pm Ответить с цитатой Вернуться к началу

AmiBroker похож на языке C amibroker is similar to C language

Few C code:
Код:


#include <stdio.h>
 
int main()
{
  int array[100], maximum, size, c, location = 1;
 
  printf("Enter the number of elements in array\n");
  scanf("%d", &size);
 
  printf("Enter %d integers\n", size);
 
  for (c = 0; c < size; c++)
    scanf("%d", &array[c]);
 
  maximum = array[0];
 
  for (c = 1; c < size; c++)
  {
    if (array[c] > maximum)
    {
       maximum  = array[c];
       location = c+1;
    }
  }
 
  printf("Maximum element is present at location %d and it's value is %d.\n", location, maximum);
  return 0;
}


Код:

int MAX =0;
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main( void )
{
   int i  = 0;
   int a[11];

   int min = 0;
   int max = 0;

   srandom( (unsigned) time(NULL) );
   a[0]=random( ) % 100 ;
   min = a[0];

for (i=1;i<11;i++)
     {
       a[i]=random( ) % 100 ;


       printf("%d\n", a[i]);

       if (a[i] > max)
            {
          max = a[i];
            }
       if (a[i] < min)
            {
          min = a[i];
            }
    }
            printf("Min: %d\n", min);
            printf("Max: %d\n", max);

return 0;
}


не знаю, как мы это делаем в AmiBroker

do not know , how we do it in amibroker??
Посмотреть профиль Отправить личное сообщение
Показать сообщения:      
Начать новую тему  Ответить на тему


 Перейти:   



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


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

File Attachment © by Meik Sievertsen