Ok thx. I'll look a bit more.
- #34,384
- Apr 29, 2020 9:15pm Apr 29, 2020 9:15pm
- Joined Feb 2007 | Status: Trader | 2,146 Posts
Trade what you see not what you hope
I will code your pivot EAs for no charge 28 replies
I will code your scalping EAs for no charge 163 replies
Oanda MT4 - Indicators and EAs not showing 2 replies
EAs and indicators relating to moutaki... 22 replies
InterbankFX has loaded its MT4 platform with custom EAs, indicators and scripts 1 reply
Disliked{quote} That is a long and I need time to digest what you are trying to say. Due to lack of sleeping, my concentration is a bit low. Anyway, Yes. Just change Color to Yellow and you will see whole currency pairs and Time frame. Also, you can turn off some of those higher time frame and you will get reduced columns, It is as same as removing those time frame. In addition, I removed those higher time frame except 1M and 5M. It works also. ( file attached) Other ones.. I have to understand what you are trying and will get back to you. {file} {image}...Ignored
Disliked{quote} I think if you open the file in an editor you will feel pretty comfortable tackling this on your own. Mql is “C++” and I am confident even a mediocre C programmer could work the file to their needs. It is simple code, a template really. In fact the Bid and Ask already are OR, each independent if statements.Ignored
Disliked{quote} It seems to work okay for me, the line isn't moving when I change time frames. Perhaps there is another reason? Also trivial but you don't need UninitializeReason() if you are using OnDeinit(), the variable in OnDeinit(const int res) is the same thing.Ignored
Disliked{quote} Lovely. Yes I agree. I need to develop my programming skills anyway for a big python project I have in mind, not trading related so this will help get my feet wet a little bit in problem solving. You've basically already given me the framework so I just need to append an additional If statement. Just one question. What syntax would I use to get the "y" out of my earlier argument? Would that be by tick or tick volume? Again, thanks again for taking the time to respond to me. I'm not well versed in mql4 syntax but basic arguments I can manage...Ignored
Disliked{quote} Often the issue is another indicator on the chart that has poor object delete code, have you tried the indicator by itself on a blank chart??Ignored
Disliked{quote} I 100% believe in youI think you’ll feel a bit like riding a bike again. The syntax is C based so it is something you know already, like variable and function data types: int, double, float, long, etc; for loops: “for(int i=0;i<20;i++)”; and if statements: “if(this||that)”. Ask and Bid are independent of ticks, they can move without any price change tick coming in, so timer is the one to use to get the change in y. There is also a millisecond timer if needed. Also start() and OnCalculate() are tick events if you need to use those...
Ignored
Disliked{quote} Thanks man, you're awesome! By the way when you said I'll use the timer to get the change in y the argument would change from this: If Bid == Bid AFTER x seconds{ If Ask moves y times; } }; To this? If Bid == Bid AFTER x seconds{ If Ask != Ask AFTER y seconds; } };Ignored
Disliked{quote} Either can work, it depends on your intended outcome. In your first example y is a count of occurrences and in the second y is a time interval. I mentioned the timer since the bid or ask can move without a tick, you'd probably want to run your code by time intervals. When you set EventSetTimer(x), this calls OnTimer() every x seconds.Ignored
Disliked{quote} Either can work, it depends on your intended outcome. In your first example y is a count of occurrences and in the second y is a time interval. I mentioned the timer since the bid or ask can move without a tick, you'd probably want to run your code by time intervals. When you set EventSetTimer(x), this calls OnTimer() every x seconds. The only issue with a straight Ask==Ask check is if the ask did move and then come back. Perhaps that might give you a different result than what you intend. My original code above does this as well, so it...Ignored
Disliked{quote} The only way to get around the straight Ask == Ask check dilemma using a timer is if the Ask !- Ask runs under a For loop x times. If all is true then the condition is set for the alarm to trigger. Thanks for bringing that to my attention since I agree if Ask !- Ask but Ask simply moved and came back then it'll throw what I intended out the window. Good lookin' out m8te!Ignored
Disliked{quote} Greetings Jeanlouie, That's amazing, that's honestly one of the best crossover indicators I have seen. Thanks again, that's really nice. Best wishes, and must success to you always LivingSoul999 Livingsoul {file}Ignored
DislikedHi Beerun I hv set the following parameters: prev_cdl_high = High[1]; prev_cdl_low = Low[1]; for buy An orderdistance of xpips above the previous candle high buy_price=prev_cdl_high+order_distance*trade_point; for sell An orderdistance of xpips below the previous candle low sell_price=prev_cdl_low-order_distance*trade_point; so buy order : OrderSend(Symbol(),OP_BUYSTOP,Lots,buy_price,slippage,buy_stop_loss, buy_take_profit, trades_comment, buy_magic_number, NULL, buy_arrow_color); I have a basic question: As prices move very fast, we will never...Ignored
const double &close[],
iClose("XxxXxx",60,1);
//+------------------------------------------------------------------+
//| RSI.mq4 |
//| Copyright 2005-2014, MetaQuotes Software Corp. |
//| http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright "2005-2014, MetaQuotes Software Corp."
#property link "http://www.mql4.com"
#property description "Relative Strength Index"
#property strict
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
#property indicator_level1 30.0
#property indicator_level2 70.0
#property indicator_levelcolor clrSilver
#property indicator_levelstyle STYLE_DOT
//--- input parameters
input int InpRSIPeriod=14; // RSI Period
//--- buffers
double ExtRSIBuffer[];
double ExtPosBuffer[];
double ExtNegBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit(void)
{
string short_name;
//--- 2 additional buffers are used for counting.
IndicatorBuffers(3);
SetIndexBuffer(1,ExtPosBuffer);
SetIndexBuffer(2,ExtNegBuffer);
//--- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtRSIBuffer);
//--- name for DataWindow and indicator subwindow label
short_name="RSI("+string(InpRSIPeriod)+")";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//--- check for input
if(InpRSIPeriod<2)
{
Print("Incorrect value for input variable InpRSIPeriod = ",InpRSIPeriod);
return(INIT_FAILED);
}
//---
SetIndexDrawBegin(0,InpRSIPeriod);
//--- initialization done
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Relative Strength Index |
//+------------------------------------------------------------------+
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[])
{
int i,pos;
double diff;
//---
if(Bars<=InpRSIPeriod || InpRSIPeriod<2)
return(0);
//--- counting from 0 to rates_total
ArraySetAsSeries(ExtRSIBuffer,false);
ArraySetAsSeries(ExtPosBuffer,false);
ArraySetAsSeries(ExtNegBuffer,false);
ArraySetAsSeries(close,false);
//--- preliminary calculations
pos=prev_calculated-1;
if(pos<=InpRSIPeriod)
{
//--- first RSIPeriod values of the indicator are not calculated
ExtRSIBuffer[0]=0.0;
ExtPosBuffer[0]=0.0;
ExtNegBuffer[0]=0.0;
double sump=0.0;
double sumn=0.0;
for(i=1; i<=InpRSIPeriod; i++)
{
ExtRSIBuffer[i]=0.0;
ExtPosBuffer[i]=0.0;
ExtNegBuffer[i]=0.0;
diff=close[i]-close[i-1];
if(diff>0)
sump+=diff;
else
sumn-=diff;
}
//--- calculate first visible value
ExtPosBuffer[InpRSIPeriod]=sump/InpRSIPeriod;
ExtNegBuffer[InpRSIPeriod]=sumn/InpRSIPeriod;
if(ExtNegBuffer[InpRSIPeriod]!=0.0)
ExtRSIBuffer[InpRSIPeriod]=100.0-(100.0/(1.0+ExtPosBuffer[InpRSIPeriod]/ExtNegBuffer[InpRSIPeriod]));
else
{
if(ExtPosBuffer[InpRSIPeriod]!=0.0)
ExtRSIBuffer[InpRSIPeriod]=100.0;
else
ExtRSIBuffer[InpRSIPeriod]=50.0;
}
//--- prepare the position value for main calculation
pos=InpRSIPeriod+1;
}
//--- the main loop of calculations
for(i=pos; i<rates_total && !IsStopped(); i++)
{
diff=close[i]-close[i-1];
ExtPosBuffer[i]=(ExtPosBuffer[i-1]*(InpRSIPeriod-1)+(diff>0.0?diff:0.0))/InpRSIPeriod;
ExtNegBuffer[i]=(ExtNegBuffer[i-1]*(InpRSIPeriod-1)+(diff<0.0?-diff:0.0))/InpRSIPeriod;
if(ExtNegBuffer[i]!=0.0)
ExtRSIBuffer[i]=100.0-100.0/(1+ExtPosBuffer[i]/ExtNegBuffer[i]);
else
{
if(ExtPosBuffer[i]!=0.0)
ExtRSIBuffer[i]=100.0;
else
ExtRSIBuffer[i]=50.0;
}
}
//---
return(rates_total);
}
//+------------------------------------------------------------------+