//+------------------------------------------------------------------+ //| IND_RiskPerTrade.mq5 | //| Copyright 2021, FxWeirdos | //| info@fxweirdos.com | //+------------------------------------------------------------------+ #property copyright "Video tutorial" #property link "https://www.youtube.com/c/fxweirdos/videos" #property version "1.00" #property strict #property script_show_inputs #property indicator_chart_window #property indicator_plots 0 #property description "Copyright 2021, FxWeirdos. Mario Gharib. Forex Jarvis. info@fxweirdos.com" #property description " " #property description "RISK DISCLAIMER : Investing involves risks. Any decision to invest in either real estate or stock markets is a personal decision that should be made after thorough research, including an assessment of your personal risk tolerance and your personal financial condition and goals. Results are based on market conditions and on each personal and the action they take and the time and effort they put in" #include // Functions for creating objects #include // Functions for pip values //--- Inputs input color cRPTFontClr = C'255,166,36'; // Font color //--- parameters double dRPTAmtRisking; // Used to calculate the overall risk double dRPTAmtRewarding; // Used to calculate the overall target int kRPT; // Used to loop all open orders to get the overall risk string sRPTObjectName; // To name all objects //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- Hide the OneClick panel ChartSetInteger(0,CHART_SHOW_ONE_CLICK,false); 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[]) { //--- Delete these objects from chart ObjectsDeleteAll(0); //--- Always reset these parameters at the beginning dRPTAmtRisking=0.0; dRPTAmtRewarding=0.0; sRPTObjectName=""; //--- Loop all open orders in order to calculate the overall risk for (kRPT=0 ; kRPT