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

Trabajo finalizado

Plazo de ejecución 9 minutos
Comentario del Ejecutor
Excellent customer. Its specifications were clear and specific. The negotiation was quite fast and fluid. Thank you very much for your Job.

Tarea técnica

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);
}
  */


Han respondido

1
Desarrollador 1
Evaluación
(514)
Proyectos
776
63%
Arbitraje
33
27% / 45%
Caducado
23
3%
Libre
2
Desarrollador 2
Evaluación
(261)
Proyectos
424
38%
Arbitraje
86
44% / 19%
Caducado
70
17%
Ocupado
3
Desarrollador 3
Evaluación
(71)
Proyectos
97
43%
Arbitraje
2
50% / 0%
Caducado
2
2%
Libre
Solicitudes similares
I have an indicator, related to RSI but adjusted. As you can see in the image, there are light blue "Aqua" rectangles that don't form on the same candle but after confirmation by two candles. This color is meant for buy signals, and there is an opposite color, gold, for sell signals. it no repaints. there are two candles for confirmation. indicator is in exe format But if you want some code that might be necessary
EA MT5 SNR 30 - 100 USD
I need a developer who can work with quickly & details. make an EA MT5 Classic Support aNd Resistance multi time frame marking single Classic support and resistance support type A and Resistance type V make an alert pop-up
Hi, Developer Scalping ea is required in mql5 for JPY currency pairs(usdjpy, audjpy,gbpjpy,cadjpy) and USD currency pairs (audUSD,EURUSD, gbpUSD, NZDUSD, USDcad, USDCHF, xauusd). Scalping ea should be profitable. Trailing stop may be required Please help on this. Note: developer should complete more than 100 projects
It is using EMA/SMA for triggers of long or short (green long/red short) and the line above or below is the stop loss, profit triggers would need to figure out or allow it until next trigger. Already in thinkscript And add parameters
Having a problem with my sell trailing stop, ordermodify isn't working for any sell order. error message notifies me when I select by ticket or it doesn't work at all if I select by position
HFT EA for prop firms 30 - 200 USD
am looking for a developer of a High Frequency Trading EA for MT5 to pass prop firms challengs. IF anyone has a Ready made HFT EA then we can discuss. I don't want HFT Arbitrage EA between slow and fast brokers. The EA has to work on all Brokers like FXPrimus/ICmarkets/Pepperstone or similar brokers and execute 100 orders per hour with 90% wins minimum. Must work on gold, 30 forex pairs and also on US30 and Nasdaq
Hello I need an HFT EA for MT5 that trade US30, BTC with low latency and high win rate! The bot should work on MT5, And can be back tested also! The bot works on real account with very low spread
Objects reader PIN 70 - 100 USD
Hi I have an indicator that create objects in the chart and using those following some rules the new indicator will create external global variables with value = 0 ( NONE ), = 1 ( BUY ) or = 2 ( SELL ). The global variable will use PIN external integer number . PINS are by now global variables (GV) whose name indicates the pair name and the PIN belonging and their value indicates it direction/action. PINS GV names
https://github.com/theshadow76/PocketOptionAPI https://lu-yi-hsun.github.io/pocketoptionapi/ i need someone to help with with connecting to this API and recieving signals from telegram channel i have created the app but can't make it connect with SSID and start trades and veiw these trades in realtime on the app if someone can help i would be thankful telegram : @sadscan
I want an indicator and its source code that returns the value of: - two moving averages in different selectable timeframes, with method Exponential and price calculation price_open; - Opening, closing, maximum and minimum of the candle in different timeframes And that returns the values ​​regardless in a chart of one minute. The input parameters: * select timeframe media1 = {1,2,3,4,5,...} * select timeframe media2

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD
Plazo límite de ejecución
de 1 a 2 día(s)