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.

Pip_Calculator

Geschrieben

Habe gestern zu Übungszwecken einen Pipkalkulator programmiert, vielleicht kann der eine oder andere ihn ja brauchen. Funktioniert auf EURO-Konten, der Dezimalpunkt trennt die Tausender.

 

//+------------------------------------------------------------------+
//| _vikke@ www.tom-next.com			 Pip_Calculator.mq4 |
//|																 |
//+------------------------------------------------------------------+
#property copyright "_vikke@ www.tom-next.com"
#property indicator_chart_window
extern int Balance = 10000;
extern double Risk = 3.0;
extern color Color1 = Aqua;
extern color Color2 = Yellow;
extern int Font_Size = 13;
extern string Font = "Courier";
string x_per_str[] = {" PIPS","EURUSD","EURJPY","EURGBP","USDCHF","USDCAD","GBPUSD","AUDUSD"};
string pip_array[] = {" 12"," 15"," 20", " 25", " 30", " 35", " 40", " 45", " 50"};
double pip_a[] = {12,15,20,25,30,35,40,45,50};
//---------------------------------------------------------------------
int init(){
return(0);
}
//---------------------------------------------------------------------
int deinit(){
ObjectsDeleteAll(0, OBJ_LABEL);
return(0);
}
//----------------------------------------------------------------------
int start(){
double maxriskeuro = Balance*Risk/100;

double multi;
double eurusd = iClose("EURUSD",0,0);
double euraud = iClose("EURAUD",0,0);
double eurcad = iClose("EURCAD",0,0);
double eurgbp = iClose("EURGBP",0,0);

int x,y;
for(x=0;x<1;x++)
for( y=0;y<9;y++)
{
 create_obj("ss"+x+y, x*80+80, y*20+40, DoubleToStr(((maxriskeuro/(10/(iClose("EURUSD",0,y))*pip_a[y]))*100)/3,1), Font_Size, Font, Color1);
}
for(x=1;x<2;x++)
for( y=0;y<9;y++)
{
 create_obj("ss"+x+y, x*80+80, y*20+40, DoubleToStr(((maxriskeuro/(10/(iClose("EURJPY",0,y))*pip_a[y]))*1)/3,1), Font_Size, Font, Color1);
}
for(x=2;x<3;x++)
for( y=0;y<9;y++)
{
 create_obj("ss"+x+y, x*80+80, y*20+40, DoubleToStr(((maxriskeuro/(10/(iClose("EURGBP",0,y))*pip_a[y]))*100)/3,1), Font_Size, Font, Color1);
}
for(x=3;x<4;x++)
for( y=0;y<9;y++)
{
 create_obj("ss"+x+y, x*80+80, y*20+40, DoubleToStr(((maxriskeuro/(10/(iClose("USDCHF",0,y))*pip_a[y]))*100)*eurusd/3,1), Font_Size, Font, Color1);
}
for(x=4;x<5;x++)
for( y=0;y<9;y++)
{
 create_obj("ss"+x+y, x*80+80, y*20+40, DoubleToStr(((maxriskeuro/(10/(iClose("USDCAD",0,y))*pip_a[y]))*100)*eurusd/3,1), Font_Size, Font, Color1);
}
for(x=5;x<6;x++)
for( y=0;y<9;y++)
{
 create_obj("ss"+x+y, x*80+80, y*20+40, DoubleToStr(((maxriskeuro/(10/(iClose("GBPUSD",0,y))*pip_a[y]))*100)*eurgbp/3,1), Font_Size, Font, Color1);
}
for(x=6;x<7;x++)
for( y=0;y<9;y++)
{
 create_obj("ss"+x+y, x*80+80, y*20+40, DoubleToStr(((maxriskeuro/(10/(iClose("AUDUSD",0,y))*pip_a[y]))*100)*euraud/3,1), Font_Size, Font, Color1);
}
//------------------------------------
for(y=0;y<9;y++)
{
create_obj("pip"+y, x, y*20+40, pip_array[y], Font_Size, Font, Color2);
}
for(x=0;x<8;x++)
{
create_obj("perString"+x, x*80, y+10, x_per_str[x], Font_Size, Font, Color2);
}

return(0);
}
//-------------------------------------------------------------------------------------------------------------------------------------
void create_obj(string obj_name, int x_dist, int y_dist, string dbl_var, int font_size, string font, color color_)
{
 ObjectCreate(obj_name,OBJ_LABEL,0,0,0,0,0);
 ObjectSet(obj_name,OBJPROP_XDISTANCE,x_dist);
 ObjectSet(obj_name,OBJPROP_YDISTANCE,y_dist);
 ObjectSetText(obj_name,dbl_var, font_size, font, color_);
}


post-1524-0-56726600-1348065594_thumb.png

Bearbeitet von vikke

Featured Replies

No posts to show

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.