i have a question: if i attack agilititrade2.ex4 with .set file in eurusd m1 it will trade?
and it makes it to optimize this setting every week?
and it makes it to optimize this setting every week?
I will code & automate your strategy for free 108 replies
Trading is a mind game - by Forex Mind Games 2 replies
Need consulting help to automate signals and execution 0 replies
How to automate signals from signal service on MT4 platform ? 1 reply
EA - Automate Trading 0 replies
Dislikedi have a question: if i attack agilititrade2.ex4 with .set file in eurusd m1 it will trade? and it makes it to optimize this setting every week?Ignored
Dislikedi have a question: if i attack agilititrade2.ex4 with .set file in eurusd m1 it will trade? and it makes it to optimize this setting every week?Ignored
It is these values that AgilityTrader can evaluate to make trading decisions. A collection of values is called a buffer. So when we describe to Agility Trader the structure of our indicator, we need to identify the buffer that is being evaluated.
Using the nonlagdot.mq4 indicator as an example -
IndicatorBuffers(5);
SetIndexStyle(0,DRAW_ARROW);
SetIndexBuffer(0,MABuffer);
SetIndexStyle(1,DRAW_ARROW);
SetIndexBuffer(1,UpBuffer);
SetIndexStyle(2,DRAW_ARROW);
SetIndexBuffer(2,DnBuffer);
SetIndexBuffer(3,price);
SetIndexBuffer(4,trend);
There are 5 buffers defined - bold type refers. The values for the dots on the chart are held in the MA Buffer which is buffer number 0. To use an indicator, you need to identify the buffer that you wish to evaluate. The up and down buffers simply take the values of the MABuffer and provide different colors to the dots.
So here is the procedure to evaluate the User Indicator.
1. Edit the indicator so that only the parameters which you need to specify are shown as inputs - Remove the extern keyword on all other user inputs
enclosed is the original code for nonlagdot inputs and then the edited code
//---- input parameters - Original code
extern int Price = 0;
extern int Length = 20;
extern int Displace = 0;
extern int Filter = 0;
extern int Color = 1;
extern int ColorBarBack = 0;
extern double Deviation = 0;
//---- input parameters - Edited code
int Price = 0;
extern int Length = 20;
int Displace = 0;
int Filter = 0;
int Color = 1;
int ColorBarBack = 0;
double Deviation = 0;
2. Describe the structure of the indicator - Note a separate reference is required for each buffer being evaluated (up to 5 buffers may be referenced)
Custom1Name = nonlagdot_AT (this must be exactly the same case and structure as exists in your amended name if you changed the name)
Custom1Parameters = 1 (the number of parameters that are user inputs - in this case we are only interested in Length)
Custom1BarLimit = 7 (in this case after 7 bars in the same direction, the signal is ignored)
Custom1BufferNum = 0 (the buffer number being referenced - in this case Buffer 0, the MABuffer)
3. Make reference to the indicator in your conditions as you would reference any other indicator.
Parameter 1 is the first input (referenced by the extern keyword), Parameter 2 the second and Parameter 3 the third
BuyEntryCondition 1 = Custom 1, Parameter 1 = 20, Shift = 0 > Custom 1, Parameter 1 = 20, Shift = 1
That describes any condition within the first 7 up dots (set by Bar Limit) where there is a Buy signal (value greater than previous value Shift 0 v Shift 1)
SellEntryCondition 1 = Custom 1, Parameter 1 = 20, Shift = 0 < Custom 1, Parameter 1 = 20, Shift = 1
That describes any condition within the first 7 down dots where there is a Sell signal (value less than previous value Shift 0 v Shift 1)
The example set file is enclosed together with the amended nonlagdot indicator
For ease of argument, I'll assume a lookback of 100 bars, however our indicator will employ logic to nominate the size of the lookback and the size of the phases will be proportional. In this situation, there will be down, level and up phases of 30 bars and a pullback of 10 bars. So here is the logic -
Close 100 bars ago - Close 71 bars ago divided by 30 is greater than 30 pips
Close 70 bars ago - Close 41 bars ago divided by 30 is less than 15 pips and greater than -15 pips
Close 40 bars ago - Close 11 bars ago divided by 30 is less than -30 pips
Close 10 bars ago - Close 1 bar ago divided by 10 is less than + 5 pips
If all those conditions are satisfied, generate a buy signal and the reverse for a sell signal.
So here is the code for the indicator -
// Cup and Handle.mq4
#property indicator_chart_window // Indicator is drawn in the main window
#property indicator_buffers 1 // Number of buffers
extern int BarCount = 101;
extern int MinSideRange = 30;
extern int MinPullBackRange = 5;
double OutputValue[]; // Declaring arrays (for indicator buffers)
int LeftSideAverage;
int RightSideAverage;
int MidAverage;
int PullBackAverage;
// INIT FUNCTION
void init() // Special function init()
{
SetIndexBuffer(0,OutputValue); // Assigning an array to a buffer
}
{
int Counter, CountedBars; // Bar index, Counted_bars
CountedBars = IndicatorCounted(); // Number of counted bars
Counter = Bars - CountedBars - 1; // Index of the first uncounted
while (Counter >= 0) // Loop for uncounted bars
{
LeftSideAverage = (Close[BarCount] - Close[BarCount - int(BarCount*.7)]) / int(BarCount *.3);
MidAverage = (Close[BarCount - int(BarCount*.7)-1] - Close[int(BarCount*.4)]) / int(BarCount *.3);
RightSideAverage = (Close[int(BarCount*.4)] - Close[int(BarCount*.1)])/ int(BarCount *.3);
PullBackAverage = (Close[int(BarCount*.1)-1] - Close[1])/ int(BarCount *.1);
OutputValue[Counter] = 0;
if (LeftSideAverage > MinSideRange && MidAverage < int(MinSideRange / 2) && RightSideAverage < MinSideRange && PullBackAverage > MinPullBackRange) OutputValue[Counter] = 1;
if (LeftSideAverage < MinSideRange && MidAverage < int(MinSideRange / 2) && RightSideAverage > MinSideRange && PullBackAverage > MinPullBackRange) OutputValue[Counter] = 2;
Counter--; // Calculating index of the next bar
}
}
MQ4 and Set file enclosed
DislikedHi Dave, Thank you for such a beautiful and sophisticated tool. I'm very interested in automating my trading ideas. How much is it to purchase an upgrade key? I have several ideas in mind that will all work with your current setup. And I do not mind sharing them publicly. If I purchase the key, and I post my ideas here, will you help me get started with the EA process? Many thanks!Ignored
Disliked{quote} Whatever timeframe you require. If you don't specify, it is the time frame of the chart to which it is attached. The demo set file does reference the 240 min timeframe in condition 3 explicitly.Ignored
DislikedDave thanks for sharing this, i can locate any pdf with install instrctions , were can i find the prest file? i registered but not opening the Windows program, already installed ex4 on experts but dunno how to use it. Thanks for helpIgnored
DislikedHi Dave, I am trading the EURUSD on these time frames M5, M15, M30, H1, H4, Daily, Weekly, Monthly. I do not use the M1 chart as it does not make a profit.Is it possible to trade all of these at the same time on the Agility Heatmap ? Cheers !!!Ignored
DislikedHello Dave, Firstly, a big Thank You for the wonderful EA you have developed. For me, it is truly ground-breaking. Secondly, a question. I want to try out a strategy where a trade exits when: Either a. TP is hit (nominated value) OR b. Trade exit conditions are met. In this case, when MACD (main) crosses above/below 0.0 I tried this out on a demo but the TP values are not set when the trade triggers. I have attached the .SET file. I'm sorry if I've missed the explanation for this in the discussion. Thanks once again. P.S.: I cannot attach the .SET...Ignored
Disliked{quote} The EA is designed so that either a TP and SL situation exists or the Exit conditions close the trade but not both. I have included a one off amendment...{file}Ignored