Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /home/ifutures/domains/ifutures.pl/public_html/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 990: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 990: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 990: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ifutures/domains/ifutures.pl/public_html/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3808: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3810: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3811: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3812: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
Sztuka inwestowania • Zobacz temat - Amibroker - sztywny stoploss

Amibroker - sztywny stoploss

Opinie, rekomendacje, porady, rozwiązania problemów

Amibroker - sztywny stoploss

Postprzez endriu » 2015-04-02, 13:05

W poniższym kodzie...:

http://twojezyskinagieldzie.pl/zarzadzanie-kapitalem-metody-wbudowane-posiadany-kapital-wielkosc-ryzyka/

Kod: Zaznacz wszystko
wstop = 0.05*Close;

Plot(Close,"Close",colorBlack,styleCandle);

ma1 = MA(Close,21);
ma2 = MA(Close,55);

Plot(ma1,"",colorRed);
Plot(ma2,"",colorBlue);

Buy = Cross(ma1,ma2);
BuyPrice = Close;
Sell = 0;
SellPrice = Close;
SetTradeDelays(0,0,0,0);

//ApplyStop(stopTypeTrailing,stopModePoint,wartstop);

LiniaStop = Null;
pozycja = 0;
wartoscStop = 0;

for(i=0; i<BarCount; i++)
{
   if(Buy[i]==1)
   {
      pozycja = 1;
      wartoscStop = Close[i]-wstop[i];
   }
   if(pozycja == 1 AND Close[i]<=wartoscStop)
   {
      Sell[i] = 1;
      pozycja = 0;
   }
   if(Close[i]-wstop[i]>wartoscStop)
      wartoscStop = Close[i]-wstop[i];
   
   if(pozycja == 1)
      LiniaStop[i] = wartoscStop;
}

PlotShapes(Buy*shapeUpArrow,colorGreen,0,Low);
PlotShapes(Sell*shapeHollowDownArrow,colorGreen,0,High);

Plot(LiniaStop,"",colorRed,styleDots);

SetPositionSize(1,spsShares);


... Pan Rafał Wysocki w prostym systemiku stosuje zwizualizowanie trailingstopa przy pomocy pętli for. Ja chciałbym natomiast poniższy aby w/w systemik reagował nie na trailing tylko na stoploss sztywny.

Wiem, że można by zastosować (ApplyStop,stopModePoint,wartstop) i usunąć całą pętle for, ale wtedy owszem system odpowiedznio działał, ale bez wizualizacji stopa na wykresie. Kombinuję, że aby w tym kodzie uzyskać należało by zamienieć..:

Kod: Zaznacz wszystko
LiniaStop[i] = wartoscStop;


..na coś w rodzaju

Kod: Zaznacz wszystko
LiniaStop[i] = cena - wstop po której została zawarta ostania transakcja.


... ale po pierwsze nie wiem czy da się coś takiego zrobić, a po drugie nie wiem jak to zapisać.

P.S Już nieaktualne:http://www.stockwatch.pl/forum/wpisy-5340_Amibroker-Zastapienie-trailingstopa-stopem-na-sztywno.aspx

Pozostał tylko jeszcze problem z Exrem ....
Pozdrawiam
Endriu
Awatar użytkownika
endriu
 
Posty: 72
Dołączenie: 2010-09-30, 19:41

Re: Amibroker - sztywny stoploss

Postprzez kardy94 » 2015-04-09, 10:09

dobrze ze znalazlem to forum. wiele sie tu mozna dowiedziec. dzieki :)
kardy94
 
Posty: 2
Dołączenie: 2015-04-09, 09:29


Powróć do Programy AT

Kto jest na forum

Użytkownicy przeglądający to forum: Brak zarejestrowanych użytkowników oraz 0 gości

cron