I would like to create an anchored vwap and multiple standard deviations from the avwap

Tâche terminée

Temps d'exécution 9 minutes
Commentaires de l'employé
Excellent customer. Its specifications were clear and specific. The negotiation was quite fast and fluid. Thank you very much for your Job.

Spécifications

I have created some code and when I execute I can see the correct values using Print but I cannot seem to get the code to plot the vwap. In my code, the vwap is not yet anchored. So, i would like it anchored to a specified time (input) and further I would like to then be able to use the indicator within an EA to create parameters such that if price interacts with the avwap or one of the standard deviations from the avwap then buy or sell. This is actually step one of my strategy since it also uses other indicators such as EMAs and multi time frame EMAs. If a developer can get this avwap and standard deviation indicator working for me then I would like to think I can learn from the code to then create more indicators that I can ultimately call in in EA to open and close positions. An alternative may be that a developer interacts with me via a tutorial using an online video conferencing tool and teaches / guides me as to what I need to do.

Here is my code as it is:

//+------------------------------------------------------------------+
//|                                                Anchored_VWAP.mq5 |
//|                                                             Aabh |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Aabh"
#property link      ""
#property version   "1.00"
#property indicator_chart_window

#property indicator_buffers 1
#property indicator_plots 1

#property indicator_type1 DRAW_LINE
#property indicator_label1 "VWAP_Daily"
#property indicator_color1 clrGhostWhite
#property indicator_style1 STYLE_SOLID
#property indicator_width1 4



//--- input parameters

input int Interval = 1;

//bool time;
//int startTime = T'0:00:00';
//int endTime = T'23:58:00';

//int startTime = 0;
//int endTime = 23;


MqlRates rates[];
double volumesum, volume_times_close, vwap_now, vwap_square, vwap_sd, u, x, y, z;
double vtc[], v[], vwap[], vwap_sqr[], vwap_SD[];
int arraylimit = 24, i = 0;


   datetime tm = TimeCurrent(); //gets current time in datetime data type
   string str = TimeToString(tm,TIME_MINUTES); //changing the data type to a string
   string current = StringSubstr(str, 0, 2); //selecting the first two characters of the datetime e.g. if it's 5:00:00 then it'll save it as 5, if it's 18 it will save 18.
   int currentTimeInt = StringToInteger(current); //changes the string to an integer

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {


   ArraySetAsSeries(rates,true);
//   ArraySetAsSeries(vwap,true);
//   ArraySetAsSeries(vwap_SD,true);
   
      

   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);

   SetIndexBuffer(0,vwap,INDICATOR_DATA);


   ObjectCreate(0,"VWAP_Daily",OBJ_LABEL,0,0,0);
   ObjectSetInteger(0,"VWAP_Daily",OBJPROP_CORNER,3);
   ObjectSetInteger(0,"VWAP_Daily",OBJPROP_XDISTANCE,180);
   ObjectSetInteger(0,"VWAP_Daily",OBJPROP_YDISTANCE,40);
   ObjectSetInteger(0,"VWAP_Daily",OBJPROP_COLOR,indicator_color1);
   ObjectSetInteger(0,"VWAP_Daily",OBJPROP_FONTSIZE,7);
   ObjectSetString(0,"VWAP_Daily",OBJPROP_FONT,"Verdana");
   ObjectSetString(0,"VWAP_Daily",OBJPROP_TEXT," ");

   

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int pReason)
  {
   ObjectDelete(0,"VWAP_Daily");

  }      
      
   
 void OnTick()

 {  
 int copied=CopyRates(
                        Symbol(),             // symbol name
                        PERIOD_CURRENT,       // Don't hard code constants PERIOD_CURRENT
                        0,                   // Shift 
                        100,                   // how many bars back    
                        rates                 // array
                     );
 
   static int   LastBarCount = 0;

ArrayResize(vtc,arraylimit);
ArrayResize(v,arraylimit);
ArrayResize(vwap,arraylimit);
ArrayResize(vwap_sqr,arraylimit);
ArrayResize(vwap_SD,arraylimit);

for(i;i<arraylimit;i++)
   {
    if (Bars(_Symbol, _Period) > LastBarCount)
      {LastBarCount = Bars(_Symbol, _Period);
      Print(LastBarCount);
      Print(i);
      Print("bar real volume " + (string) rates[1].tick_volume);
      Print("bar close " + (string) rates[1].close);
      volume_times_close = rates[1].tick_volume * rates[1].close;
      volumesum = rates[1].tick_volume;

      Print("vtc " + (string) volume_times_close);


      
      //volume times close
      Print("vtc " + (string) volume_times_close);
      if (i == 0)
         ArrayFill(vtc,i,1,volume_times_close);
      else
         ArrayFill(vtc,i,1,vtc[i-1]+volume_times_close);
      Print("vtc array " + (string) i + " " + (string) vtc[i]);
      
      //volume
      Print("v " + (string) volumesum);
      if (i == 0)
         ArrayFill(v,i,1,volumesum);
      else
         ArrayFill(v,i,1,v[i-1]+volumesum);
      Print("v array " + (string) i + " " + (string) v[i]);
      
      //vwap
      ArrayFill(vwap,i,1,vtc[i]/v[i]);
      Print("vwap array " + (string) i + " " + (string) vwap[i]);
      
      //vwap squared      
//      Print("vwap_sqr " + (string) vwap_square);
      u = rates[1].close-vwap[i];
      Print("u " + u);
      x = pow(u,2);
      Print("x " + x);
      Print("x*volume " + x*volumesum);
//      y = v[i];
//      z = x*v;
      if (i == 0)
         ArrayFill(vwap_sqr,i,1,pow((rates[1].close-vwap[i]),2)*volumesum);
      else
         ArrayFill(vwap_sqr,i,1,vwap_sqr[i-1]+pow((rates[1].close-vwap[i]),2)*volumesum);
      Print("vwap_sqr array " + (string) i + " " + (string) vwap_sqr[i]);
      
      //vwap standard deviaton
      ArrayFill(vwap_SD,i,1,MathSqrt(vwap_sqr[i]/v[i]));
      Print("vwap_SD array " + (string) i + " " + (string) vwap_SD[i]);      
      

      }
    else
    return; 

   
   
   
   }

/*
ObjectCreate(0,"High",OBJ_HLINE,0,0,PriceInformation[HighestCandle].high); //set object properties
         ObjectSetInteger(0,"High",OBJPROP_WIDTH,2);              //set object width
         ObjectSetInteger(0,"High",OBJPROP_COLOR,clrIndigo);      //set object colour
         */
}


/*
 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[])
{
   return (rates_total);
}
  */


Répondu

1
Développeur 1
Évaluation
(508)
Projets
764
63%
Arbitrage
33
27% / 45%
En retard
23
3%
Gratuit
2
Développeur 2
Évaluation
(252)
Projets
404
38%
Arbitrage
83
41% / 19%
En retard
70
17%
Chargé
3
Développeur 3
Évaluation
(71)
Projets
97
43%
Arbitrage
2
50% / 0%
En retard
2
2%
Gratuit
Commandes similaires
***** THIS IS FOR MT5 ***** The indicator now makes 5 lines and I use it on US30 It is for NY session and has inputs for times - open and close It creates lines at NY open NY open line 100 point 200 points I want to add 300 pt lines and 400 point lines I want On/off box added for dotted or dashed 50 - 150 - 250 and 350 lines I want alerts when the candles reach the 100 - 200 ect...lines but would love "Push
Job Title: MQL5 Trading Bot Code Debugging and Optimization** **Description:** We are seeking an experienced MQL5 developer proficient in debugging and optimizing trading bot codes. The current project involves fixing existing code that runs into debugging issues without errors and optimizing it for efficient performance in live trading environments. **Responsibilities:** - Debug existing MQL5 trading bot code to
Active expert 250+ USD
hi, I must do changes to a dashboard with manual input of trader and active expert. Budget 250$ Can do? the budget is correct based on job to do. If you want me to increase the budget you can message me
HELLO DEAR DEV'S. I'VE AN EA BUT IT STOP WORKING WHEN MT4 HAS BEEN UPDATED TO THE LATEST VERSION (1420). SO I NEED A GOOD DEVELOPPER THAT COULD UPDATE THIS EA TO THE LATEST VERSION OF MT4 SO I CAN USE IT. NB: IT'S A SINGLE FILE (.EX4) AND THE PRICE CAN BE NEGOCIATED TO BE SUITABLE FOR BOTH PARTIES. THANK YOU
hey friends, I am looking to build a smart trading robot, for the capital market. He knew how to trade in all the different types of trade. Example - in shares, currencies, index, indices, ETFs, funds, commodities, options, futures and so on. Suitable for trading on all stock exchanges in the world. It will be possible to install the trading robot in the MetaTrader 5 trading software. But it will also be possible to
STI EA 30 USD
I need to convert this MT4 indicator into MT5 EA/indicator. The problem is I only have the .ex4 file bt not .mq4 file and it is also a repainting indicator. I need preliminary assessment if the conversion can be done based on .ex4 file first before exploring the EA details further. Attached is the indicator Budget below is just indicative for the assessment. We can discuss further once the conversion can be done and
This mql4 got entry blue line and exit red line and pips inside also calculated it uses haiken Ashi and murray Math settings if you this you up for this job let's discuss it we will talk more when you are chosen thanks in advance
i Want to convert this Trading View Code to Mt4 Indicator indicator("NEOM Smart Money Concepts ", "NEOM Smart Money Concepts " , overlay = true , max_labels_count = 500 , max_lines_count = 500 , max_boxes_count = 500 , max_bars_back = 500) //-----------------------------------------------------------------------------{ //Constants //-----------------------------------------------------------------------------{ color
Hello Amazing developer am looking for profitable EA for mt4 and made for some past year and i will be looking forward for your bid if you have mt4 EA let Negotiate in the contact box best regards
Hello Amazing developer am looking for profitable EA for mt4 and made for some past year and i will be looking forward for your bid if you have mt4 EA let negotitate in the contact box best regartds

Informations sur le projet

Budget
30+ USD
Pour le développeur
27 USD
Délais
de 1 à 2 jour(s)