Geschrieben von guidoh am 13.09.2005, 18:14:
Hi,
ist mit Tradestation-ID meine Seriennummer gemeint? Wenn nicht, dann bitte Bescheid sagen was sonst, Rechnung liegt ja vor.
zum Signal : hab es nochmal umgeschrieben, wie folgt :
input : puffer01(0),puffer02(0),puffer03(0),puffer04(0),puffer05(0),puffer06(0);
input : anz01(0),anz02(0),anz03(0),anz04(0),anz05(0),anz06(0);
input : day_begin(0),day_end(0),long_possible(false),short_possible(false);
if short_possible = true and time >= day_begin then begin
if marketposition = 0 and time < day_end and currententries = 0 then sell ("first_sell") anz01 contracts at (highd(0)-puffer01) stop;
if marketposition = -1 and time < day_end and currententries = 1 then sell ("second_sell") anz02 contracts at (entryprice(1)-puffer02) limit;
if marketposition = -1 and time < day_end and currententries = 2 then sell ("third_sell") anz03 contracts at (entryprice(2)-puffer03) limit;
if marketposition = -1 and time < day_end and currententries = 3 then sell ("fourth_sell") anz04 contracts at (entryprice(3)-puffer04) limit;
if marketposition = -1 and time < day_end and currententries = 4 then sell ("fifth_sell") anz05 contracts at (entryprice(4)-puffer05) limit;
if marketposition = -1 and time < day_end and currententries = 5 then sell ("sixth_sell") anz06 contracts at (entryprice(5)-puffer06) limit;
if marketposition = -1 and time = day_end then exitshort all contracts on close;
end;
if long_possible = true and time >= day_begin then begin
if marketposition = 0 and time < day_end and currententries = 0 then buy ("first_buy") anz01 contracts at (lowd(0)+puffer01) stop;
if marketposition = 1 and currententries = 1 and time < day_end then buy ("second_buy") anz02 contracts at (entryprice(1)+puffer02) stop;
if marketposition = 1 and currententries = 2 and time < day_end then buy ("third_buy") anz03 contracts at (entryprice(2)+puffer03) stop;
if marketposition = 1 and currententries = 3 and time < day_end then buy ("fourth_buy") anz04 contracts at (entryprice(3)+puffer04) stop;
if marketposition = 1 and currententries = 4 and time < day_end then buy ("fifth_buy") anz05 contracts at (entryprice(4)+puffer05) stop;
if marketposition = 1 and currententries = 5 and time < day_end then buy ("sixth_buy") anz06 contracts at (entryprice(5)+puffer06) stop;
if marketposition = 1 and time = day_end then exitlong;
end;
Also das Short Signal funktioniert einwandfrei.
Beim longsignal gibt es ein problem :
Wie im Bild zu sehen, führt er den ersten Trade falsch aus. (als puufer 1 sind es hier 50 Punkte). der 2. trade klappt dann. wenn ich maxbarsettings von 50 zurücknehme, führt er den 1. falschen trade auch eher aus. woran kann das liegen?
danke nochmal für die Tipps.
guidoh
|