اف اكس ارابيا..الموقع الرائد فى تعليم فوركس Forex

اف اكس ارابيا..الموقع الرائد فى تعليم فوركس Forex (https://fx-arabia.com/vb/index.php)
-   منتدى المؤشرات و الاكسبيرتات (https://fx-arabia.com/vb/forumdisplay.php?f=6)
-   -   أحتاج مساعدة من الإخوان المبرمجين (https://fx-arabia.com/vb/showthread.php?t=52835)

babouche007 09-03-2016 05:23 AM

أحتاج مساعدة من الإخوان المبرمجين
 
السلام عليكم إخواني

قمت بمحاولت تصميم مؤشر
أضع فيه مكان وقف الخسارة
و قيمة الخسارة
ثم مؤشر سيقوم بإعطائي لوط الدخول لكي تكون قيمة وقف الخسارة مثلا 5 دولار

أرجو المساعدة لأني أضن أن هناك خطئ في العملية الحسابية التي قمت بها
وشكرا

كود:

//+------------------------------------------------------------------+
//|                                          gestion_du_capital.mq4 |
//|                                      Copyright 2015, hamza Corp. |
//|                                            https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, hamza Corp."
#property link      "https://www.mql5.com"
#property version  "1.00"
#property strict
#property indicator_chart_window

input double Stop_Loss = 1.0950 ;
input int Gestion_Capital = 5 ;
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                        |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
 
//---
  return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
double sprea = MarketInfo(Symbol(),MODE_SPREAD);

double V_P = MarketInfo(Symbol(),MODE_TICKVALUE);
double Valeur_spread = sprea * V_P ;
double N_P_B = ((Ask - Stop_Loss)* 10000)+Valeur_spread;
double N_P_S = (Stop_Loss - Bid)* 10000;
double SL_B = V_P * N_P_B ;
double Formule_1_B = SL_B / Gestion_Capital;
double Formule_2_B = (0.1 / Formule_1_B) ;

 //Comment("spread : "+DoubleToStr(sprea/10,1));
 Comment(Formule_2_B);
 
 
 
//--- return value of prev_calculated for next call
  return(rates_total);
  }
//+------------------------------------------------------------------+


اسلام العوامى 09-03-2016 10:31 AM

رد: أحتاج مساعدة من الإخوان المبرمجين
 
اقتباس:

المشاركة الأصلية كتبت بواسطة babouche007 (المشاركة 859365)
السلام عليكم إخواني

قمت بمحاولت تصميم مؤشر
أضع فيه مكان وقف الخسارة
و قيمة الخسارة
ثم مؤشر سيقوم بإعطائي لوط الدخول لكي تكون قيمة وقف الخسارة مثلا 5 دولار

أرجو المساعدة لأني أضن أن هناك خطئ في العملية الحسابية التي قمت بها
وشكرا

كود:

//+------------------------------------------------------------------+
//|                                          gestion_du_capital.mq4 |
//|                                      Copyright 2015, hamza Corp. |
//|                                            https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, hamza Corp."
#property link      "https://www.mql5.com"
#property version  "1.00"
#property strict
#property indicator_chart_window

input double Stop_Loss = 1.0950 ;
input int Gestion_Capital = 5 ;
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                        |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
 
//---
  return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
double sprea = MarketInfo(Symbol(),MODE_SPREAD);

double V_P = MarketInfo(Symbol(),MODE_TICKVALUE);
double Valeur_spread = sprea * V_P ;
double N_P_B = ((Ask - Stop_Loss)* 10000)+Valeur_spread;
double N_P_S = (Stop_Loss - Bid)* 10000;
double SL_B = V_P * N_P_B ;
double Formule_1_B = SL_B / Gestion_Capital;
double Formule_2_B = (0.1 / Formule_1_B) ;

 //Comment("spread : "+DoubleToStr(sprea/10,1));
 Comment(Formule_2_B);
 
 
 
//--- return value of prev_calculated for next call
  return(rates_total);
  }
//+------------------------------------------------------------------+



،،،اهلا بك اخي الفاضل ، لحساب لوت الدخول يجب ان يتوفر لديك عدد نقاط الخسارة ثم تقوم بقسمة مبلغ الخسارة علي عدد نقاط الخسارة ثم الناتج علي 10،،،

،،،تحياتي،،،


الساعة الآن 09:10 AM

Powered by vBulletin® Copyright ©2000 - 2024

جميع الحقوق محفوظة الى اف اكس ارابيا www.fx-arabia.com