Because you would need to apply a template on a live chart
Posts made by jstap
-
RE: How to Show Moving Average Indicator on Chart on MT5posted in Questions & Answers
-
RE: Delete indicator with a button in Backtestposted in Questions & Answers
Apply template doesn't work on backtest, would work on a live chart though
-
RE: How to Show Moving Average Indicator on Chart on MT5posted in Questions & Answers
You could use the draw block, but this isn't the same.
-
RE: How to Show Moving Average Indicator on Chart on MT5posted in Questions & Answers
Don't know if you can, possibly on init apply template, should work on live/demo but I have never tried
-
RE: Stand alone stop loss EAposted in Questions & Answers
Purple position created (set to all trades), Pink blocks for each trade (set to all trades) pink modify stopes, (all on, on trade tab)
-
RE: How to Show Moving Average Indicator on Chart on MT5posted in Questions & Answers
I have a template with the exact name as my EA, when I test the template loads, for live/demo right click and add the template
-
RE: how to define price levelposted in Questions & Answers
Then you need to start with that, once you have the IDs you can work with that, there is no simple method or indicator that can do this
-
RE: How to implement TDI indicator on fxDreemaposted in Questions & Answers
Ask any question and I'll help you with what it does, there is too much to try and explain it all. In most blocks, you can select RSI indicator, the value from this is the current line value
-
RE: Creating a buttonposted in Questions & Answers
If you search the forum you will find lots of info on this. Generally draw button off oninit, read button ontick, if on activate a close block, and redraw the button off
-
RE: check distance between positions then close one of themposted in Questions & Answers
You can save the price when trade is placed in a variable, or get the value in pink blocks separately, save if needed, test and add a new shared link to see what is happening if not working
-
RE: How to implement TDI indicator on fxDreemaposted in Questions & Answers
You'll have to check this, thank chat gbp if works:
//+------------------------------------------------------------------+
//| CustomIndicator.mq4 |
//| Copyright 2024, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 Black
#property indicator_color2 Red
#property indicator_color3 Aqua
#property indicator_color4 Aqua
#property indicator_color5 Yellow
#property indicator_color6 Blue// Indicator buffers
double rsiBuffer[];
double ma2Buffer[];
double ma7Buffer[];
double bbUpperBuffer[];
double bbLowerBuffer[];
double ma34Buffer[];// Input parameters
input int rsiPeriod = 13; // RSI period: 13 or 21
input int maPeriod1 = 2; // MA period 1: 2
input int maPeriod2 = 7; // MA period 2: 7
input int bbPeriod = 34; // Bollinger Bands period: 34
input double bbDeviation = 1.618; // Bollinger Bands deviation: 1.618
input int maPeriod3 = 34; // MA period 3: 34//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
// Indicator buffers mapping
SetIndexBuffer(0, ma2Buffer);
SetIndexBuffer(1, ma7Buffer);
SetIndexBuffer(2, bbUpperBuffer);
SetIndexBuffer(3, bbLowerBuffer);
SetIndexBuffer(4, ma34Buffer);
SetIndexBuffer(5, rsiBuffer);// Indicator lines
SetIndexStyle(0, DRAW_LINE);
SetIndexLabel(0, "MA(2)");SetIndexStyle(1, DRAW_LINE);
SetIndexLabel(1, "MA(7)");SetIndexStyle(2, DRAW_LINE);
SetIndexLabel(2, "BB Upper");SetIndexStyle(3, DRAW_LINE);
SetIndexLabel(3, "BB Lower");SetIndexStyle(4, DRAW_LINE);
SetIndexLabel(4, "MA(34)");SetIndexStyle(5, DRAW_LINE);
SetIndexLabel(5, "RSI");// Levels for RSI
IndicatorSetInteger(INDICATOR_LEVELS, 3);
IndicatorSetDouble(INDICATOR_LEVELVALUE, 0, 32.0);
IndicatorSetDouble(INDICATOR_LEVELVALUE, 1, 50.0);
IndicatorSetDouble(INDICATOR_LEVELVALUE, 2, 68.0);IndicatorShortName("Custom Indicator");
return(INIT_SUCCEEDED);
}//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total, // size of the price[] array
const int prev_calculated, // bars handled on a previous call
const datetime &time[], // Time
const double &open[], // Open
const double &high[], // High
const double &low[], // Low
const double &close[], // Close
const long &tick_volume[], // Tick Volume
const long &volume[], // Real Volume
const int &spread[]) // Spread
{
int limit = rates_total - prev_calculated;
if (limit > rates_total - bbPeriod - 1)
limit = rates_total - bbPeriod - 1;// Calculate RSI
for (int i = 0; i < limit; i++)
{
rsiBuffer[i] = iRSI(NULL, 0, rsiPeriod, PRICE_CLOSE, i);
}// Calculate MA(2) on RSI
for (int j = 0; j < limit; j++)
{
ma2Buffer[j] = iMAOnArray(rsiBuffer, rates_total, maPeriod1, 0, MODE_SMA, j);
}// Calculate MA(7) on MA(2)
for (int k = 0; k < limit; k++)
{
ma7Buffer[k] = iMAOnArray(ma2Buffer, rates_total, maPeriod2, 0, MODE_SMA, k);
}// Calculate Bollinger Bands on RSI
for (int m = 0; m < limit; m++)
{
double bbMid = iMAOnArray(rsiBuffer, rates_total, bbPeriod, 0, MODE_SMA, m);
double bbStdDev = StdDev(rsiBuffer, bbPeriod, m);
bbUpperBuffer[m] = bbMid + bbDeviation * bbStdDev;
bbLowerBuffer[m] = bbMid - bbDeviation * bbStdDev;
}// Calculate MA(34) on RSI
for (int n = 0; n < limit; n++)
{
ma34Buffer[n] = iMAOnArray(rsiBuffer, rates_total, maPeriod3, 0, MODE_SMA, n);
}return(rates_total);
}//+------------------------------------------------------------------+
//| Custom function to calculate standard deviation |
//+------------------------------------------------------------------+
double StdDev(const double &array[], int period, int start_index)
{
double sum = 0, mean = 0, stddev = 0;
for (int p = 0; p < period; p++) // Use a different variable than 'i'
{
sum += array[start_index + p];
}
mean = sum / period;
for (int q = 0; q < period; q++) // Use a different variable than 'i'
{
stddev += MathPow(array[start_index + q] - mean, 2);
}
return(MathSqrt(stddev / period));
}
//+------------------------------------------------------------------+ -
RE: Opening buy and sell limit orders at the quarter of the body of the ID1 candle helpsposted in Questions & Answers
pass block - comment block showing the relevant value, write something in the label for it to work
-
RE: Opening buy and sell limit orders at the quarter of the body of the ID1 candle helpsposted in Questions & Answers
I think I should have used + not -, put these values into a comment to check if you are getting a relevant value, and then use a process of elimination to work out which block is causing the issue.
-
RE: How to implement TDI indicator on fxDreemaposted in Questions & Answers
Google is how I would search for it, you can use the EX file but if the values aren't in the data window you can't use it.
-
RE: EA not taking trades unless recently syncedposted in Questions & Answers
What I will sometimes do is, value 0 adjusted to +MaxSpread pips
-
RE: How to implement TDI indicator on fxDreemaposted in Questions & Answers
@Chandler As @biztet has said you will need to get these values and work with them from the standard indicator, or find a custom indicator with buffers. If no data is in the window, then FX cannot get the value
-
RE: bufferposted in Questions & Answers
I think it's probably
ENUM_APPLIED_PRICE
PRICE_CLOSE
Not 100% sure but I think I have seen that icon before with enum types -
RE: Delete indicator with a button in Backtestposted in Questions & Answers
You don't need the pass block, they just need to be connected. I do not know how you would delete MAs
