Hello,
How can i find Identity Market Condition with good accuracy rate like Trend (Up-Trend/Down-Trend), Range and Breakout?. Can someone share there strategy how they find and how is the accuracy?
Hello,
How can i find Identity Market Condition with good accuracy rate like Trend (Up-Trend/Down-Trend), Range and Breakout?. Can someone share there strategy how they find and how is the accuracy?
I love finding consistent trends to follow. There are no complicated ways of doing this - put your chart up on screen, go to the other side of the room and if you can still see a trend, its a trend.
Of course you can use moving averages to gauge the comparative strength and consistency of different trends, either historically or currently with dfferent markets. But not even the perfect trend is 100% reliable.
An indicator would be useful, but only if you were blind and could not see the price chart.
I want this to add into my EA to automate it. If you tell me technically like what kind of Indicator, settings and conditions to apply to find trend direction?
So, based on that, i will write the code and add into my EA
I would not use an off-chart technical indicator to find or even gauge a trend.
I have used moving averages to confirm and gauge trends I have already found from the price action. for example, to confirm a consistent uptrend, I might want price to be above the 20, 50 and 100EMA’s: and I might want the 20 to be above the 50 and the 50 above the 100. the choice of paraneters is yours.
I might also look at the number of weeks in the last few months in which price in an uptrend has closed below the 50: or maybe breached the 100.
I might look at how many weekly bars currently overlap - if it is 5 or more, that sounds more like a range than a trend.
But I only look at these things once I already saw the price trend with my own eyes.
But i am using EA to trade. I am more interested in Algo Trading, so i want to hard-code the trend strategy.
// Define the periods for EMAs
int ema20_period = 20;
int ema50_period = 50;
int ema100_period = 100;
// Define the handle variables for EMAs
int ema20_handle, ema50_handle, ema100_handle;
// Define the OnStart function where the trading logic will be implemented
int OnStart()
{
// Calculate the handle for each EMA
ema20_handle = iMA(NULL, 0, ema20_period, 0, MODE_EMA, PRICE_CLOSE, 0);
ema50_handle = iMA(NULL, 0, ema50_period, 0, MODE_EMA, PRICE_CLOSE, 0);
ema100_handle = iMA(NULL, 0, ema100_period, 0, MODE_EMA, PRICE_CLOSE, 0);
// Check for Uptrend conditions
bool uptrendConditions = iClose(NULL, 0, 0) > iMA(NULL, 0, ema20_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iClose(NULL, 0, 0) > iMA(NULL, 0, ema50_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iClose(NULL, 0, 0) > iMA(NULL, 0, ema100_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iMA(NULL, 0, ema20_period, 0, MODE_EMA, PRICE_CLOSE, 0) > iMA(NULL, 0, ema50_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iMA(NULL, 0, ema50_period, 0, MODE_EMA, PRICE_CLOSE, 0) > iMA(NULL, 0, ema100_period, 0, MODE_EMA, PRICE_CLOSE, 0);
// Check for Downtrend conditions
bool downtrendConditions = iClose(NULL, 0, 0) < iMA(NULL, 0, ema20_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iClose(NULL, 0, 0) < iMA(NULL, 0, ema50_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iClose(NULL, 0, 0) < iMA(NULL, 0, ema100_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iMA(NULL, 0, ema20_period, 0, MODE_EMA, PRICE_CLOSE, 0) < iMA(NULL, 0, ema50_period, 0, MODE_EMA, PRICE_CLOSE, 0)
&& iMA(NULL, 0, ema50_period, 0, MODE_EMA, PRICE_CLOSE, 0) < iMA(NULL, 0, ema100_period, 0, MODE_EMA, PRICE_CLOSE, 0);
// Confirm Uptrend
if (uptrendConditions)
{
Print("Uptrend confirmed!");
}
// Confirm Downtrend
else if (downtrendConditions)
{
Print("Downtrend confirmed!");
}
else
{
Print("No clear trend conditions are met.");
}
return 0;
}
basically, you want to find the price level where price move to direction which you have chosen, moving average is one of this method
Can you provide me settings which you use and condition when you decide it might be Buy trend or sell trend.
So, i can code based on the logic.
Like in 3 points if i have to say:-
A suggestion is to measure the percentage change for the day.