Ehrlich gesagt ich finde es komisch, erst nach PositionsTotal() durch alle Positionen zu iterieren, dann aber mit PositionSelect(_Symbol) nicht eine sondern alles des Symbols auszuwählen - ich werde fragen, ob das beabsichtigt ist.
Versuch doch einmal statt PositionSelect(_Symbol) einfach PositionGetTicket(index); - Beispiel:
int p = PositionsTotal(); while(p-->0) { // returns the number of open positions ulong ticket=PositionGetTicket(p);
Ehrlich gesagt ich finde es komisch, erst nach PositionsTotal() durch alle Positionen zu iterieren, dann aber mit PositionSelect(_Symbol) nicht eine sondern alles des Symbols auszuwählen - ich werde fragen, ob das beabsichtigt ist.
Versuch doch einmal statt PositionSelect(_Symbol) einfach PositionGetTicket(index); - Beispiel:
Hallo Carl,
nun ja, ich will ja von alle offenen Positionen eines Symbols die Pips im Profit oder im Negativen akkumulieren.
was ich nicht verstehe, das er über Print 50 ausgibt und im Debugger 6.xxE-313, was ja als Wert quasi nix ist
lg
In der Referenz (F1) steht zu PositionSelect(): "Bei einer unabhängigen Verrechnung von Positionen (ACCOUNT_MARGIN_MODE_RETAIL_HEDGING) können gleichzeitig mehrere Positionen pro Symbol vorhanden sein. In diesem Fall wählt PositionSelect die Funktion mit dem kleinsten Ticket."
Darum hab ich ja die vor schleife über positions total, das ich die im live betrieb noch mehr filtern musss ist klar, wie gesagt, das kommt beim backtest raus
PositionSelect() liefert Dir aber dann immer nur ein und dieselbe Position! Ist gedacht für Netting-Konten, da gibt es je Symbol immer nur eine Position!
Stimmt, aber das ist noch kein Grund für das ergebnis im debugger. Im print stimmt es ja, ich geb dir recht, ich müsste nich mit dem PositionSelectByTicket die Position bestimmen, aber das ist noch immer kein Grund für e^-313
- Freie Handelsapplikationen
- Über 8.000 Signale zum Kopieren
- Wirtschaftsnachrichten für die Lage an den Finanzmärkte
Sie stimmen der Website-Richtlinie und den Nutzungsbedingungen zu.
Hallo Freunde,
ich hab da mal was getestet, bitte keine Diskussion ob Sinnvoll oder nicht, ich hab nur probiert über ein einfaches Grid System Order zu eröffnen,
jetzt hab ich das mal laufen lassen und bin verwundert, warum mir der Debugger diesen Wert anzeigt.
anbei mal der Code, sollte so funktionieren
dazu bekomme ich im Debugger folgenden Wert raus
und über die Print Ausgabe krieg ich folgenden Wert als letztes im Journal des graphischen Interfaces
der Unterschied macht aus, das er immer mehrere Orders nachsetzt.
btw, ich teste das am Dow30
bediene ich den debugger falsch?
ich habe den Haltepunkt hier stehen
ACHTUNG: Zeilennummer ein wenig verschoben da ich den Header weggelassen habe
kann mir hier jemand sagen was ich falsch mache? ausser 2 Glas rotwein trinken beim proggen?
danke
amando