[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 325
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Can you tell me how to prescribe when the difference of two EMAs (five days/minimum and maximum) increases, to sell long at the maximum EMA and buy short at the minimum EMA?
I use "Rastvor" in global variable header as the difference of two EMAs .
How do I write this code in the trading criteria?
I.e.Vol_Arr[] should be initialized as a global array as I understand it.
The question is of course a null question, BUT.
1. Why are the volumes displayed correctly in the indicator?
2. When calculating, I accessAOBuffer3[] and notVol_Arr[].
Thank you!
When declaring an array (not a buffer) you should explicitly specify its size.... at least.
I.e.Vol_Arr[] should be initialized as a global array as I understand it.
The question is of course a null question, BUT.
1. Why are the volumes displayed correctly in the indicator?
2. When calculating, I accessAOBuffer3[] and notVol_Arr[].
Thank you!
You don't allocate memory for this array(Vol_Arr[]) either statically or dynamically.
2. As far as I see from the code, the difference of MA and not volumes is calculated in theAOBuffer3[] array
The volumes are counted inExtMapBuffer1.
Vol_Arr[] can be initialized as a global one or with a static modifier - you can choose your own, but memory should be allocated in any case or you can link it to the indicator buffer, as well as the previous two arrays - sure, there are plenty of variants.
1) Both arrays that you use are connected with indicator buffers, i.e. the memory is allocated for them (though implicitly).
......
Vladislav, I have reviewed the code again. A part of the code withVol_Arr[]was left from the old version of the indicator, I deleted it.
I think the error is still in this part of the code, but I don't understand where! I have commented out this part of the code in more details.
Vladislav, I have reviewed the code again. A part of the code withVol_Arr[]was left from the old version of the indicator, I deleted it.
I think that the error is still in this part of the code, but I don't understand where! I commented this part of the code in more detail.
Here it is:
Thank you again!
Here it is:
At a glance:
The highlighted fragment is outside the loop and it uses the loop counter i - something is wrong either with the logic or with the implementation
Why do you need the figures as CSV files?
Needed for testing and debugging recognition algorithms.
Write them yourself to understand them rather than taking someone else's.
Write what exactly? You mean, mark up the shapes on the chart yourself and export the appropriate chunks of history? This solution is the first on the queue so far, but I still hope that someone has already done it. After all, it's just a chore.
Plenty does not mean better!
Let me disagree. The larger the test suite, the more statistically reliable the result of the program will be.
p.s. The question is still valid.(See question in this post )
Hi all!!!
Could you please tell me what code is needed to make a long close at the maximum of the current MA.
Below is the actual trading criteria and highlighted in red what is not clear.
Also not clear how to tell the program to exit a position,
after increasing the difference between MA1 and MA2?
//--------------------------------------------------------------- 5 --
// Trade criteria
MA_1_t=iMA(NULL,0,Period_MA_1,0,MODE_EMA,PRICE_HIGH,1); // MA_1
MA_2_t=iMA(NULL,0,Period_MA_2,0,MODE_EMA,PRICE_LOW,1); // MA_2
if ( iHigh (Symbol(),Period(),0) >= MA_1_t) //
{
Opn_S=true;
}
if ( iLow (Symbol(),Period(),0) <= MA_2_t) //
{
Opn_B=true; // Open Buy criterion
}
if(what code is needed to make a long close at today's maximum iMA?? )
{
Cls_B=true;
}
//--------------------------------------------------------------- 6 --
Just a quick look:
The highlighted fragment is outside the loop and it uses the i loop counter - something is wrong either with the logic or with the implementation
Thank you Vladislav! Something has started to work. But for some reason only like this! :(
Another question why text labels are not displayed in the indicator window?