Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
I tried to code it myself but the indicator line doesn't show in the indicator window when I run it. If you go here MANUAL - TECHNICAL INDICATORS it has a definition of the indicator with the formula for calculating it.
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----check for errors
if (counted_bars<0) return(-1);
//----last counted bar will be recounted
if (counted_bars>0) counted_bars--;
int k = Bars - counted_bars;
double midptT, midptY, boxR, midptM, EMV;
while (k>0)
{
midptT = (High[k] + Low[k])/2;
midptY = (High[k+1] + Low[k+1])/2;
midptM = midptT - midptY;
boxR = Volume[k]/(High[k] - Low[k]);
EMV = midptM / boxR;
ExtMapBuffer1[k] = EMV;
k--;
}
I am looking for some help I have an EA that I'm using on demo and also learning to code with. I am trying to figure out how to add a comment to the system to show me which of the 4 entry criteria was used to open the position. eg if long2 was used then show long2 signal
I am looking for some help I have an EA that I'm using on demo and also learning to code with. I am trying to figure out how to add a comment to the system to show me which of the 4 entry criteria was used to open the position. eg if long2 was used then show long2 signal
any help would be great
cheers
Beno
After your condition is met and you use Ordersend() command, just insert a Comment(), Alert(), or Print() statement. Whichever you want to use.
Something like this:
if ( long2 == true)
{
Ordersend();
{
Print(" long2 signal taken ");
}
}
buysig = Long || Long2 || Long3 || Long4;
sellsig = Short || Short2 || Short3 || Short4;
closebuy=sellsig;
closesell=buysig;
if (curprof>=AccountBalance()*ProfitExit/100.0) {
exit=true;
}
if (last>0 && (Time[0]-last)/(Period()*60)>=CancelOrderBars) {
remorder=true;
}
}
void CheckForOpen() {
int res,tr;
//---- sell conditions
co=CalculateCurrentOrders(Symbol());
if(sellsig && lastsig!=-1) {
co=CalculateCurrentOrders(Symbol());
if (co==0) {
if ( Short == true)
if ( Short2 == true)
if ( Short3 == true)
res = OpenStop(OP_SELLSTOP,LotsRisk(StopLoss), Low[shift]-OrderPipsDiff*Point, StopLoss, TakeProfit1);
Print(" Short signal taken ");
Print(" Short2 signal taken ");
Print(" Short3 signal taken ");
Print(" Short4 signal taken ");
}
lastsig=-1;
last=Time[0];
return;
}
//---- buy conditions
if(buysig && lastsig!=1) {
co=CalculateCurrentOrders(Symbol());
if (co==0) {
if ( Long == true)
if ( Long2 == true)
if ( Long3 == true)
if ( Long4 == true)
res = OpenStop(OP_BUYSTOP,LotsRisk(StopLoss), High[shift]+OrderPipsDiff*Point, StopLoss, TakeProfit1);
Print(" Long signal taken ");
Print(" Long2 signal taken ");
Print(" Long3 signal taken ");
Print(" Long4 signal taken ");
can you help me?why there are many mistakes in the code?
this is to calculate SMMA:
for(j=0;j<Bars;j++)
{
for(i=0,sum=0;i<ma_period;i++)
{
sum=sum+Close[j+i];
// buffer[j]=(sum-sum/ma_period+Close[j+i])/ma_period;
}
buffer[j]=(sum-sum/ma_period+Close[j])/ma_period;
}
Hi everyone.
I am stuck on a programming issue. Does anyone know how to use 1 indicator result to change another setting? For example, if the daily stockasti was above 20, I would want a moving average of (x). I tried to get the code working below but to know avail. I don't seem to be able to get the switch or if else command to work eithor.
double fourhrUP;
double daystoch1 = iStochastic(NULL, PERIOD_D1,5, 3, 3, MODE_SMA, 0, MODE_MAIN,1);
double daystoch20 = 20;
if (daystoch1 > daystoch20) four_hrUP = 5 ;
double iMA( string symbol, int timeframe,four_hrUP, int ma_shift, int ma_method, int applied_price, int shift)
Hi everyone.
I am stuck on a programming issue. Does anyone know how to use 1 indicator result to change another setting? For example, if the daily stockasti was above 20, I would want a moving average of (x). I tried to get the code working below but to know avail. I don't seem to be able to get the switch or if else command to work eithor.
double fourhrUP;
double daystoch1 = iStochastic(NULL, PERIOD_D1,5, 3, 3, MODE_SMA, 0, MODE_MAIN,1);
double daystoch20 = 20;
if (daystoch1 > daystoch20) four_hrUP = 5 ;
double iMA( string symbol, int timeframe,four_hrUP, int ma_shift, int ma_method, int applied_price, int shift)
Where's your MA's variable?
Maybe this could help
double ma4hr=iMA( string symbol, int timeframe,four_hrUP, int ma_shift, int ma_method, int applied_price, int shift);
if the stoch calculation is in the same loop, let say "for(int shift=limit-1; shift>=0; shift--)", the stoch code should be