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

工作已完成

执行时间9 分钟
员工反馈
Excellent customer. Its specifications were clear and specific. The negotiation was quite fast and fluid. Thank you very much for your Job.

指定

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


反馈

1
开发者 1
等级
(512)
项目
773
63%
仲裁
33
27% / 45%
逾期
23
3%
空闲
2
开发者 2
等级
(256)
项目
415
38%
仲裁
86
44% / 19%
逾期
70
17%
繁忙
3
开发者 3
等级
(71)
项目
97
43%
仲裁
2
50% / 0%
逾期
2
2%
空闲
相似订单
Hi Developer, I would like to create the Scalping EA based for Mt4 on the investing.com data https://www.investing.com/currencies/eur-usd-technical EA have timing to adjust time to trade. follow the broker time. From starting time to end time EA have a adjustable Lot size (0.01 incremental to 0.01) EA have a adjustable TP (1pip to 100pip incremental 1pip) EA have a adjustable SL (1pip to 100pip incremental 1pip) EA
This is not an EA that actually opens/closes trades. Instead this project involves creating a dashboard where the user can create a grid trade scenario with initial entry and scale trade pip distances, lot sizes for each trade, and draw down amount. It then calculates the break-even + profit level where all trades would close. For each new scale trade the BE+ point is recalculated which is then displayed on the
Hi I have the code in pinescript for an indicator that I need done in Ninja Trader, I wanted this indicator in NT bcs I chart in NT, and if the indicator could also have been an automated strategy even better. Please confirm that it will be an indicator and Automated Trading Strategy
Hi guys I would like to k ow if someone has experience with machine learning models? I would like to train a model to identify if there is a range market or trendy market based on several parameters like EMA and ATR for example. If we use for example a 20 and 50 EMA and we measure the distance between both lines the algo should oearn if the trend is strong or weak. If it‘s steong it keeps trending and if it‘s weak
Hello I need a very simple indicator This indicator should show the highest floating or history drawdown of the account It means that it can display the highest number that the account drawdown to be displayed on the chart in this format max drawdown account(xxxx$$) ...date(00/00/00)time:(00:00) max drawdown currency ..( currency name with max drwadown) . (xxxx$$) date(00/00/00)time:(00:00) thanks
I want have the possibility to increase lotsize not alone by Lot-multiplier rather I want add a fix-lot increase for excample for 0,05 lot. I want have this for buy / sell and hedge-buy and hedge sell
Hello, I‘m interested in an indicator to predict the next candles probability (bullish or bearish). But honestly I have no idea how to do this. Would be interested in your opinion how we can create such an indicator. Please let me know if you‘ve done similar work
Profitable EA HFT 50 - 300 USD
From a long time i am searching for a profitable EA i have lost a lot , and now i have only 300$ to buy a profitable EA , i wish to say with 0 losses but some or most traders they don't want to hear this i am really tired of searching for a programmer to just create me a profitable EA with the least losses or zero losses maybe nearly 1 year i am searching i just need an HFT EA that can work very well on MT4,MT5
у нас есть стратегия, нам нужно написать mql5-код ​​для тестера стратегий МТ5,Цена договорная. Мой контакт @abbosaliyev из Telegram Программист должен знать РУССКИЙ ИЛИ УЗБЕКСКИЙ язык. Задание: разработать тестер, который использует шаблон условий на открытие и проверит весь исторический график на всех доступных таймфреймах. Остальная информация будет предоставлена ​​после согласования цены
New york session based strategy 9:30 open Price takes out buy side or sell side liquidity Usually using 15min high and lows 5m entry Price takes out that high/low and price must close strongly back into the zone Is price is above price we have a sell bias vis versa for buys Sl is at the high or low with option for “offset” for cushion Tp is usually the opposite High or low. Would like the option for set pips-points &

项目信息

预算
30+ USD
开发人员
27 USD
截止日期
 1  2 天