Wszystkie pytania dozwolone początkujących programistów
Chociażby:
double Close[]
Series array that contains close prices for each bar of the current chart.
Series array elements are indexed in the reverse order, i.e., from the last one to the first one. The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as Bars-1.
double iClose( string symbol, int timeframe, int shift)
Returns Close value for the bar of indicated symbol with timeframe and shift. If local history is empty (not loaded), function returns 0.
For the current chart, the information about close prices is in the predefined array named Close[].
Parameters:
symbol - Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Przejrzyj dokumentacje. Tam będziesz miał wszystko napisane plus przykłady by lepiej zrozumieć. Tutaj na forum również masz odpowiedzi na wiele pytań. Wystarczy poszukać.
double Close[]
Series array that contains close prices for each bar of the current chart.
Series array elements are indexed in the reverse order, i.e., from the last one to the first one. The current bar which is the last in the array is indexed as 0. The oldest bar, the first in the chart, is indexed as Bars-1.
double iClose( string symbol, int timeframe, int shift)
Returns Close value for the bar of indicated symbol with timeframe and shift. If local history is empty (not loaded), function returns 0.
For the current chart, the information about close prices is in the predefined array named Close[].
Parameters:
symbol - Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Przejrzyj dokumentacje. Tam będziesz miał wszystko napisane plus przykłady by lepiej zrozumieć. Tutaj na forum również masz odpowiedzi na wiele pytań. Wystarczy poszukać.
fx-forum
- Pierz Andrzej
- Przyjaciel Forum
- Posty: 1200
- Rejestracja: 02 lip 2006, 14:17
- SceptycznyProgramista
- Stały bywalec
- Posty: 37
- Rejestracja: 02 kwie 2011, 23:51
- SceptycznyProgramista
- Stały bywalec
- Posty: 37
- Rejestracja: 02 kwie 2011, 23:51
Nadal nie wiem co daje sygnały kupna bo podałeś jakieś zmienne. Podejrzewam, że są to jakieś średnie kroczące, które po zamknięciu świeczki i przecięciu dają sygnał po którym za 30 świeczek ma być otwarta pozycja. Możesz zamiast przypisywać tym zmiennym wartość średnich kroczących ostatnich świeczek przypisywać wartość średnich 30-tej świeczki i sprawdzić czy się przetną.
np.
Albo jeśli Ci to nie pasuje użyć funkcji sprawdzającej czy pojawiła się nowa świeczka i odliczać jakąś zmienną (ja dałem x) do 30:
przed int start() dodajesz funkcję
a w programie:
np.
Kod: Zaznacz cały
iMA(NULL, 0, 13, 0, MODE_SMMA, PRICE_CLOSE,[b]30[/b]);
przed int start() dodajesz funkcję
Kod: Zaznacz cały
bool isNewBar() { // Funkcja sprawdzająca czy pojawiła się nowa świeczka
static int prevTime;
bool newBar=false;
if(Time[0]!=prevTime) {
newBar=true;
prevTime=Time[0];
}
return(newBar);
}
Kod: Zaznacz cały
if (isNewBar()) // Polecenia gdy pojawiła się nowa świeczka
{
if (buysignal==1) x++;
if (buysignal==0) x=0;
if (x==30) // Polecenia gdy przez 30 świeczek buysygnal=1
{
x=0;
[b] Tu dajesz polecenia otwarcia pozycji[/b]
}
}
Ostatnio zmieniony 30 kwie 2012, 02:21 przez Japco, łącznie zmieniany 3 razy.
- SceptycznyProgramista
- Stały bywalec
- Posty: 37
- Rejestracja: 02 kwie 2011, 23:51
Chodziło mi o to żeby sygnał przecięcia był zapisywany do zmiennej trwał przez następne 30 świeczek, gdyż następny warunek przy spełnieniu powyższego by oznaczał zajęcie pozycji.
Chodzi o to istnieje przecięcie, to zmienna ustawiana jest na wartość 1 i sprawdzany teraz jest 2 warunek
if(bsingal==1 & 2 warunek) i wtedy podejmowana jest decyzja.
Chodzi o to żeby ten bsignal =1 przez 30 świec od wystąpienia przecięcia się świec
Chodzi o to istnieje przecięcie, to zmienna ustawiana jest na wartość 1 i sprawdzany teraz jest 2 warunek
if(bsingal==1 & 2 warunek) i wtedy podejmowana jest decyzja.
Chodzi o to żeby ten bsignal =1 przez 30 świec od wystąpienia przecięcia się świec