I need an help on this question: how to shift horizontally arrows signals of a simple ma cross indicator?
I tried this but it shift only on the left, i need even on the right.
Thanks
PS: to shift the values now you have to use + values to shift the arrows to the right and - values to shift the values to the left (attaching the test code and it works OK for any case of shifting the arrows - left or right)
mladen: Does that mean that there should be two volty channel indicators?
mladen
Sorry for not answering sooner, I was hopping to come back with a solution to the indicator question but that didn't happen
Yes, that's correct. sorry for the misunderstanding. I was answering steven about the 2MA indicator. I was unable to use the existing indicator for both entry & reentry as MR Tools did for the PrCh indicator, though my EA could never get the reentry correct, It like swing at smoke.
Anyway I can do it in the EA with 2 voltys so no need to create this indicator.
pls can u help me code this indicator to EA I only want it to trade one candle when the arrow appear and close it when the candle close pls u can make it option i need it
I´m trying to make an alert based on shved supply - demand indicator in accordance with stochastic crossover. I am informed that this indicator can be used to crate EA´s since it stores info in buffers however i am not super confident reading and understanding mql4 yet and has no mmore then 2-3 month of experimentin time.
Therefore i hope someone out there could help me write the iCustom line to check wether the price is within zoene or not.
//+------------------------------------------------------------------+//| Indicator: chan.mq4 |//| Created with EABuilder.com |//| http://eabuilder.com |//+------------------------------------------------------------------+#property copyright"Created with EABuilder.com"#property link"http://eabuilder.com"#property version"1.00"#property description""#include <stdlib.mqh>
#include <stderror.mqh>
//--- indicator settings#property indicator_chart_window#property indicator_buffers2#property indicator_type1 DRAW_ARROW#property indicator_width1 5#property indicator_color1 0xFFAA00#property indicator_label1 "Buy"#property indicator_type2 DRAW_ARROW#property indicator_width2 5#property indicator_color2 0x1A00FF#property indicator_label2 "Sell"//--- indicator buffersdouble Buffer1[];
double Buffer2[];
double myPoint; //initialized in OnInitvoid myAlert(string type, string message)
{
if(type == "print")
Print(message);
elseif(type == "error")
{
Print(type+" | chan @ "+Symbol()+","+Period()+" | "+message);
}
elseif(type == "order")
{
}
elseif(type == "modify")
{
}
}
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
IndicatorBuffers(2);
SetIndexBuffer(0, Buffer1);
SetIndexEmptyValue(0, 0);
SetIndexArrow(0, 241);
SetIndexBuffer(1, Buffer2);
SetIndexEmptyValue(1, 0);
SetIndexArrow(1, 242);
//initialize myPoint
myPoint = Point();
if(Digits() == 5 || Digits() == 3)
{
myPoint *= 10;
}
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime& time[],
constdouble& open[],
constdouble& high[],
constdouble& low[],
constdouble& close[],
constlong& tick_volume[],
constlong& volume[],
constint& spread[])
{
int limit = rates_total - prev_calculated;
//--- counting from 0 to rates_totalArraySetAsSeries(Buffer1, true);
ArraySetAsSeries(Buffer2, true);
//--- initial zeroif(prev_calculated < 1)
{
ArrayInitialize(Buffer1, 0);
ArrayInitialize(Buffer2, 0);
}
else
limit++;
//--- main loopfor(int i = limit-1; i >= 0; i--)
{
if (i >= MathMin(5000-1, rates_total-1-50)) continue; //omit some old rates to prevent "Array out of range" or slow calculation //Indicator Buffer 1if(iStochastic(NULL, PERIOD_CURRENT, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, i) < 20
&& iStochastic(NULL, PERIOD_CURRENT, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, i+1) > 20//Stochastic Oscillator crosses below fixed value
!!!!! && iCustom(NULL, PERIOD_CURRENT, "shved_supply_and_demand", i ***************** check if price is in upper zone
)
{
Buffer1[i] = Low[i]; //Set indicator value at Candlestick Low
}
else
{
Buffer1[i] = 0;
}
//Indicator Buffer 2if(iStochastic(NULL, PERIOD_CURRENT, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, i) > 80
&& iStochastic(NULL, PERIOD_CURRENT, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, i+1) < 80//Stochastic Oscillator crosses above fixed value
!!!! && iCustom(NULL, PERIOD_CURRENT, "shved_supply_and_demand", i *************** check if price is in lower zone
)
{
Buffer2[i] = High[i]; //Set indicator value at Candlestick High
}
else
{
Buffer2[i] = 0;
}
}
return(rates_total);
}
//+------------------------------------------------------------------+
I dont expect anyone to invest time in helping me out, but if i dont post i dont have any chances at all, so I tought id give it a try.
I´m trying to make an alert based on shved supply - demand indicator in accordance with stochastic crossover. I am informed that this indicator can be used to crate EA´s since it stores info in buffers however i am not super confident reading and understanding mql4 yet and has no mmore then 2-3 month of experimentin time.
Therefore i hope someone out there could help me write the iCustom line to check wether the price is within zoene or not.
I dont expect anyone to invest time in helping me out, but if i dont post i dont have any chances at all, so I tought id give it a try.
////// checking if the price is withing the lower zone////if (Close[i] <= iCustom(NULL, PERIOD_CURRENT, "shved_supply_and_demand", 6,i) &&
Close[i] >= iCustom(NULL, PERIOD_CURRENT, "shved_supply_and_demand", 7,i))
////// checking if the price is withing the upper zone////if (Close[i] <= iCustom(NULL, PERIOD_CURRENT, "shved_supply_and_demand", 4,i) &&
Close[i] >= iCustom(NULL, PERIOD_CURRENT, "shved_supply_and_demand", 5,i))
////// PS: that indicator stores values only for current bar in the buffers, so it works only for i==0//////
dotmund: pls can u help me code this indicator to EA I only want it to trade one candle when the arrow appear and close it when the candle close pls u can make it option i need it
You would use 1 2ma for overall trend and another for short term highs & lows re-entry.
Hi coders.
I need an help on this question: how to shift horizontally arrows signals of a simple ma cross indicator?
I tried this but it shift only on the left, i need even on the right.
Thanks
Hi coders.
I need an help on this question: how to shift horizontally arrows signals of a simple ma cross indicator?
I tried this but it shift only on the left, i need even on the right.
Thanks
Did you try shifting the buffer instead of shifting the single value
Something like :
And then revert these lines to have no shift at all
Hi coders.
I need an help on this question: how to shift horizontally arrows signals of a simple ma cross indicator?
I tried this but it shift only on the left, i need even on the right.
Thanks
PS: to shift the values now you have to use + values to shift the arrows to the right and - values to shift the values to the left (attaching the test code and it works OK for any case of shifting the arrows - left or right)
Does that mean that there should be two volty channel indicators?
mladen
Sorry for not answering sooner, I was hopping to come back with a solution to the indicator question but that didn't happen
Yes, that's correct. sorry for the misunderstanding. I was answering steven about the 2MA indicator. I was unable to use the existing indicator for both entry & reentry as MR Tools did for the PrCh indicator, though my EA could never get the reentry correct, It like swing at smoke.
Anyway I can do it in the EA with 2 voltys so no need to create this indicator.
Thanks for the help
Ray
Hello.
I´m trying to make an alert based on shved supply - demand indicator in accordance with stochastic crossover. I am informed that this indicator can be used to crate EA´s since it stores info in buffers however i am not super confident reading and understanding mql4 yet and has no mmore then 2-3 month of experimentin time.
Therefore i hope someone out there could help me write the iCustom line to check wether the price is within zoene or not.
I dont expect anyone to invest time in helping me out, but if i dont post i dont have any chances at all, so I tought id give it a try.
Peace and love fellow traders
Hello.
I´m trying to make an alert based on shved supply - demand indicator in accordance with stochastic crossover. I am informed that this indicator can be used to crate EA´s since it stores info in buffers however i am not super confident reading and understanding mql4 yet and has no mmore then 2-3 month of experimentin time.
Therefore i hope someone out there could help me write the iCustom line to check wether the price is within zoene or not.
I dont expect anyone to invest time in helping me out, but if i dont post i dont have any chances at all, so I tought id give it a try.
Peace and love fellow traders
Do something like this (check the comments too)
Do something like this (check the comments too)
Thank you, you must be the kindest administrator of any page. Your work is so apperciated.
Take care.
pls can u help me code this indicator to EA I only want it to trade one candle when the arrow appear and close it when the candle close pls u can make it option i need it
pls help me out