honest_knave: I never knew it was called camel case. Thanks!
Looks like the Moderator deleted my previous Post because it had a WikiPedia link, so just do a search on WikiPedia (or Google) for some history and details about "Camel Case".
Fernando Carreiro: Looks like the Moderator deleted my previous Post because it had a WikiPedia link, so just do a search on WikiPedia (or Google) for some history and details about "Camel Case".
Your post was removed as it was a double. The same link is already posted.
Continuing from #23 and encapsulating in a function #26, I now show a struct that works on both MT4 and MT5. (For post-build 600, I've changed the invalid dots (#29) in variable names, and approprate ints to standard enumerations.)
Hello, i have a quick (and painless, i hope) question about iCustom: let's say that i have 3 indicators called Ind_A, Ind_B and Ind_C, and i have an Expert Advisor called EA.
the EA calls all the 3 indicators using icustom, passing their arguments and getting the results by indexing their respctive buffers.
i attach my 3 indicator on the EURUSD chart and i run my EA; let's focus on the indicator Ind_A, he is running as indicator but at the same time is executed by the EA: the instance is the same or we have two instances of ind_A running? (i mean, one instance runs on his own and the other instance lives inside the EA).
in suche case, each instance has his own buffer? or is the buffer shared between all the instances of the indicator?
Sorry to wake up this thread again. But I thought my question belongs to this topic.
I try to access 2 buffers from a custom indicator trend-target, the indicator has one input = 60, and two buffers Band UP and Band LO
using
double Value1 = iCustom(Symbol(),0,"TrendTarget.ex4",60,0,1,0);
double Value2 = iCustom(Symbol(),0,"TrendTarget.ex4",60,0,0,1);double Value1 = iCustom(Symbol(),0,"TrendTarget.ex4",60,0,1,0);
Comment("iCustom returned v1= "+Value1+ " and value2= ",Value2);
is the way I set parameters for this iCustom correct? because I seem not to get the Band Up and Band LO values not exact to the buffers in data watch panel pls check the attached picture. Only the 2 or 3 first decimal digits or 3e right but for a FX quote all 4 digits must be correct is it right?
I hope the coder and experienced users on MQL5 can help me quickly correct this issue? Thanks in advance
----------------------------------------------------------------------------------------------------- Apropos what is your indicator has 5 inputs and 4 buffers,
double value1 = iCustom(Symbol(),0,"indicator",a1,a2,a3,a4,a5,1,0,0,0,0); //with BarIndex=0, when only check on close or 1= when check on every tick;
double value2 = iCustom(Symbol(),0,"indicator",a1,a2,a3,a4,a5,0,1,0,0,0);
double value3 = iCustom(Symbol(),0,"indicator",a1,a2,a3,a4,a5,0,0,1,0,0);
double value4 = iCustom(Symbol(),0,"indicator",a1,a2,a3,a4,a5,0,0,0,1,0);
thank you for your correction I just found an example " Combined Use of Programs" (https://book.mql4.com/samples/shared) in mql5 I think that example in codig is what I need. I will study that part, if have question in my programing I hope you would help me to get it run getting more stable and more profit
It was said earlier that according to MQL4 rules trade functions cannot be used in custom indicators, that is why for automated trading Expert Advisors or scripts should be used. However, the resource-saving technology used for calculations in indicators (see Creation of Custom Indicators) is widely used when creating trading programs. In most...
I have the code this way now I cn see the buffers 1, 2 of the TrendTarget (But still not all 4 digits correct!!!), I set the BarsIndex value on every stick to 1 because I like to recheck the TrendTarget
But I still have problem. I use TrendTarget like a filter
if(tik <= 5 && Ask>Band_UP) ///////////////ONLY can open SELL////////////////
{
////////////////////// TP1 SL1 ///////////////////////////////////
openOrder(Symbol(), OP_SELLSTOP,LotSize,sellPrice,sellPrice+SL1*point(), sellPrice-TP1*point(),"_Sell_1",MagicNumber,exp,Crimson);
}
if(tik <= 5 && Bid<Band_LO) ///////////////ONLY can open BUY////////////////
{
////////////////////// TP1 SL1 ///////////////////////////////
openOrder(Symbol(), OP_BUYSTOP,LotSize,buyPrice,buyPrice-SL1*point(), buyPrice+TP1*point(),"_Buy_1",MagicNumber,exp,Navy);
}
but after its run, I attach the TrendTarget indicator and I see the EA still opened many trades in between the channel!!!!!
In the picture I add the TrendTarget after it starts. When I create a tester template with include TrendTarget (parameter TF=60) the channel only show for the first X bars, then I can only see the price curve, why is it? How can I simple add the Trend Target indicator for visual checking where orders are opened?
I like to use in the code the value_UP in the past, similare the use of close: before yesterday Close[2], yesterday Close[1], curren close Close[0]? Is it possible?
Problem I still have with the scap test EA are following:
1rst problem: I can see the buffers 1, 2 of the TrendTarget (But still not all 4 digits correct!!!), is it important? for EURUSD quote 1.0907 I thought when the price value should be compared with TrendTarget upper channel or lower channel, those values of TrendTarget should be exact correct at least 4 decimal digits. I set the BarsIndex value on every stick to 1 because I like to recheck the TrendTarget
2nd problem: But I still have problem. I use TrendTarget like a filter.
but after its run, I attach the TrendTarget indicator and then I see the EA still opened many trades in between the channel!!!!!
3rd problem: In the attached picture I have to add the TrendTarget after it starts. When I create a tester template with include TrendTarget (parameter TF=60) the TrendTarget channel is only shown for the first X bars, maybe 100, then I can only see the price curve, why is it?
4rth problem: How can I simple add the Trend Target indicator for run-time visual checking where orders are opened?
5th problem: I like to use in the code the value_UP in the past, similar to the use of close: before yesterday Close[2], yesterday Close[1], current close Close[0]? Is it possible? Because there could be a longer than few bars break-out, in that case I like to change the strategy to breakout trading, instead, only an theory i still can not know how to do it in coding
6th problem: When condition is touched, for example I like to open only 1 order, here because price remains many bar above upper channel so condition is right always, it open until my account runs out! How to do sending only one order , then wait for condition to change.?
7th problem: Does any one know what the trendtarget is it seems to me a trrend line or MA(x) of price with +/- 1xATR(14) added to each side is that correct. Has someone the code for it?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Looks like the Moderator deleted my previous Post because it had a WikiPedia link, so just do a search on WikiPedia (or Google) for some history and details about "Camel Case".
Hello, i have a quick (and painless, i hope) question about iCustom: let's say that i have 3 indicators called Ind_A, Ind_B and Ind_C, and i have an Expert Advisor called EA.
the EA calls all the 3 indicators using icustom, passing their arguments and getting the results by indexing their respctive buffers.
i attach my 3 indicator on the EURUSD chart and i run my EA; let's focus on the indicator Ind_A, he is running as indicator but at the same time is executed by the EA: the instance is the same or we have two instances of ind_A running? (i mean, one instance runs on his own and the other instance lives inside the EA).
in suche case, each instance has his own buffer? or is the buffer shared between all the instances of the indicator?
Many thanks!
Sorry to wake up this thread again. But I thought my question belongs to this topic.
I try to access 2 buffers from a custom indicator trend-target, the indicator has one input = 60, and two buffers Band UP and Band LO
using
is the way I set parameters for this iCustom correct? because I seem not to get the Band Up and Band LO values not exact to the buffers in data watch panel pls check the attached picture. Only the 2 or 3 first decimal digits or 3e right but for a FX quote all 4 digits must be correct is it right?
I hope the coder and experienced users on MQL5 can help me quickly correct this issue? Thanks in advance
-----------------------------------------------------------------------------------------------------
Apropos what is your indicator has 5 inputs and 4 buffers,
Like this above?
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
Like this above?
Absolutely not.
Absolutely not.
thank you for your correction I just found an example " Combined Use of Programs" (https://book.mql4.com/samples/shared) in mql5 I think that example in codig is what I need. I will study that part, if have question in my programing I hope you would help me to get it run getting more stable and more profit
Absolutely not.
I have the code this way now I cn see the buffers 1, 2 of the TrendTarget (But still not all 4 digits correct!!!), I set the BarsIndex value on every stick to 1 because I like to recheck the TrendTarget
But I still have problem. I use TrendTarget like a filter
but after its run, I attach the TrendTarget indicator and I see the EA still opened many trades in between the channel!!!!!
In the picture I add the TrendTarget after it starts. When I create a tester template with include TrendTarget (parameter TF=60) the channel only show for the first X bars, then I can only see the price curve, why is it?
How can I simple add the Trend Target indicator for visual checking where orders are opened?
I like to use in the code the value_UP in the past, similare the use of close: before yesterday Close[2], yesterday Close[1], curren close Close[0]? Is it possible?
1rst problem:
I can see the buffers 1, 2 of the TrendTarget (But still not all 4 digits correct!!!), is it important? for EURUSD quote 1.0907 I thought when the price value should be compared with TrendTarget upper channel or lower channel, those values of TrendTarget should be exact correct at least 4 decimal digits.
I set the BarsIndex value on every stick to 1 because I like to recheck the TrendTarget
2nd problem:
But I still have problem. I use TrendTarget like a filter.
but after its run, I attach the TrendTarget indicator and then I see the EA still opened many trades in between the channel!!!!!
3rd problem:
In the attached picture I have to add the TrendTarget after it starts. When I create a tester template with include TrendTarget (parameter TF=60) the TrendTarget channel is only shown for the first X bars, maybe 100, then I can only see the price curve, why is it?
4rth problem:
How can I simple add the Trend Target indicator for run-time visual checking where orders are opened?
5th problem:
I like to use in the code the value_UP in the past, similar to the use of close: before yesterday Close[2], yesterday Close[1], current close Close[0]? Is it possible? Because there could be a longer than few bars break-out, in that case I like to change the strategy to breakout trading, instead, only an theory i still can not know how to do it in coding
6th problem:
When condition is touched, for example I like to open only 1 order, here because price remains many bar above upper channel so condition is right always, it open until my account runs out! How to do sending only one order , then wait for condition to change.?
7th problem:
Does any one know what the trendtarget is it seems to me a trrend line or MA(x) of price with +/- 1xATR(14) added to each side is that correct. Has someone the code for it?