Zum Inhalt springen
View in the app

A better way to browse. Learn more.

#T/N/X/T

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Frage zu "OrdersTotal"

Geschrieben

So vorerst aber nun genug zur Charttechnik eigentlich wollte ich ja hier was lernen! :tongue:

 

Ich suche nach einer Lösung des OrdersTotal Befehls:

 

total = OrdersTotal();

if(total < 2)

 

Zwei offene Aufträge sind ok, wenn es buy und sell ist. Aber 2x buy oder 2x sell dürfte nicht ausgeführt werden.

 

Könnte mir da vielleicht jemand helfen?

 

MfG Michael

Featured Replies

Geschrieben

Ich bin mir nicht ganz sicher was du genau machst, daher gibts wohl einige Möglichkeiten.

 

Aber ich denke am sinnvollsten ist es die Orderaufgabe selbst zu kontrollieren. Also bei total >= 2 einfach nicht nach weiteren Einstiegen suchen. Und bei total > 0 nur Einstiege erlauben die entgegen der letzten Richtung liegen.

 

also

 

int lastdirection = 0;

if ( total >= 2 ) return(0);

if ( total == 1 ) {
 if( OrderSelect(1, SELECT_BY_POS) == true) {
switch(OrderType()) {
  case OP_BUY:
  case OP_BUY_LIMIT:
  case OP_BUY_STOP:
	 lastdirection = OP_BUY;
	 break;
  case OP_SELL:
  case OP_SELL_LIMIT:
  case OP_SELL_STOP:
	 lastdirection = OP_SELL;
	 break;
}
 }
}

 

und dann vor der Order:

if( (total == 1 && lastdirection == OP_SELL) && ... ) // go long

 

if( (total == 1 && lastdirection == OP_BUY) && ... ) // go short

Bearbeitet von Tommyknocker

Geschrieben
  • Autor

Hi Tommyknocker,

 

dank dir erst einmal. Muss ich mal ausprobieren, melde mich dann später. :tongue:

  • 3 Wochen später...
Geschrieben

Du kannst aber auch eine Funktion pro Richtung machen.

 

Eine die prüft ob Du Long-Positionen hast und eine die das Gegenteil prüft. Dann musst nur noch in der Start()-Funktion den Rest regeln.

 

Hoffe ich habe es halbwegs gut ausgedrückt :news:

 

greetz NC

Dein Kommentar

Du kannst jetzt schreiben und Dich später registrieren. Wenn Du ein Konto hast, melde Dich jetzt an, um unter Deinem Benutzernamen zu schreiben.

Gast
Auf dieses Thema antworten...

Account

Navigation

Suche

Suche

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.