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.

MT4-Script Buy/Sell mit SL und TP und MM

(0 Bewertungen)

Ich nutze seit kurzem diese 2 Scripts aus dem forexfactory-Forum zur Tradeplatzierung short und long, weil es mir sehr viel Zeit und Rechnerei erspart.

Kurze Beschreibung:

Im Metaeditor habe ich vorab den Stop, das TakeProfit, das Risiko in Prozent und je nach Broker Microlots angepasst. Somit brauche ich bei einer Marketorder nur noch das Buy- oder das Sellscript auf den Chart ziehen, mit ok bestätigen und thats it.

Zum Platzieren eine Limitorder muss ich zusätzlich noch den Entrykurs eintippen. Dank eingebauten Moneymanagement wird die Lotgröße selbst berechnet.

 

buy_script01.GIFbuy_script02.GIF

//+------------------------------------------------------------------+
//|											  Buy  with SL and TP |
//|							   Copyright © 2008, smjones		  |
//|											   sjcoinc			|
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, smjones"
#property link	  "sjcoinc2000@yahoo.com"


#property show_inputs

extern int	NumberOfOrders = 1;
extern bool   UseActualSlTp = false;
extern double StopLossPrice = 0.0000;
extern double TakeProfitPrice = 0.0000;
extern string Note="0 in Entry field means Market Order Buy";
extern double Entry = 0.0000;
extern bool   MicroOrdersAllowed = true;
extern bool   MiniOrdersAllowed = true;

extern bool   UseMoneyMgmt = true;
extern double RiskPercent = 3;
extern double Lots = 0.1;
extern double StopLoss = 30;
extern double TakeProfit = 20;

extern string Comments = "Buy Script";



//+------------------------------------------------------------------+
//| script program start function									|
//+------------------------------------------------------------------+
int start()
 { 
 double Risk = RiskPercent / 100;
 int OrdersizeAllowed = 0;
 int Mode = OP_BUYSTOP;
 if (Ask > Entry && Entry > 0) Mode = OP_BUYLIMIT; 
 if (Entry == 0)  {Entry = Ask; Mode = OP_BUY;}
 double SLB = Entry - StopLoss*Point, TPB = Entry + TakeProfit*Point;

 if (UseActualSlTp)
  {
	 StopLoss = (Entry-StopLossPrice)/Point;
	 SLB = StopLossPrice;
	 TPB = TakeProfitPrice;	
  }
 if (MiniOrdersAllowed) OrdersizeAllowed=1;
 if (MicroOrdersAllowed) OrdersizeAllowed=2;		
 if (UseMoneyMgmt)  
  Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),OrdersizeAllowed);	   

 if ((Lots < 0.01&&MicroOrdersAllowed) || (Lots < 0.1&&MiniOrdersAllowed&&MicroOrdersAllowed==true))
  {
	 Comment("YOUR LOTS SIZE IS TOO SMALL TO PLACE!");
  } 

 if(Lots > 0)
 for (int i=0;i<NumberOfOrders;i++)
  {
	 OrderSend(Symbol(),Mode, Lots, Entry, 2,SLB , TPB, Comments, 0, NULL, LimeGreen);
  }

	   
  return(0);
 }
//+------------------------------------------------------------------+

1 Kommentar

Empfohlene Kommentare

Gast
Kommentar schreiben...

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.