tcc123:
I am moving here from thinkorswim (trying to anyways). I wrote a "strategy" I used pretty successfully there which I would eventually try to get set up as an EA over here, but first I obviously need my indicators set up. Below is what I have for trendnoisebalance indicator thus far, and below the ### signs is the thinkorswim code for (just for your reference). I have not finished adding in the portion where the value resets when the EMA's cross yet because there is a simple error in here somewhere I can't get past. I have tried plotting all of the variables individually and all work w/ exception to the "trend". Please let me know if where I am making my error (or errors, in all likelihood).
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
tcc123:
Watch out for type casting for example . . .
double smf = 2 / (1 + trendlength);
. . . 2 / 8 will be typecast to 0 as you have int / int . . . instead do . . .
double smf = 2.0 / (1.0 + trendlength);
- SRC
- On MT4 v434, division quotient don't give floating point values(Bug??) - MQL4 forum
- Contradictory information on IndicatorCounted() - MQL4 forum
double cpc=0; double smf = 2 / (1 + trendlength); for(int i=0; i<limit; i++) { double rel=Close[i]-Close[i+1]; cpc=cpc+rel;
Always count down. You are using future values to create older lines.- After the first time, limit will mostly be zero, so cpc will always be the same as rel, and trend will always be the same as rel *2/(1+trendlength). Count down and create other buffers so you can use the previous value of cpc and trend.
thanks for the help guys, i will try to keep these things in mind if i post again.
tcc123:
thanks for the help guys, i will try to keep these things in mind if i post again.
Could you please do as I asked and edit your first post . . .
thanks for the help guys, i will try to keep these things in mind if i post again.
i would like to edit it but i do not see how to edit an existing post...or delete one for that matter. could you tell me where to do so...i apologize for the ignorance
tcc123:
i would like to edit it but i do not see how to edit an existing post...or delete one for that matter. could you tell me where to do so...i apologize for the ignorance
Thank you for editing i would like to edit it but i do not see how to edit an existing post...or delete one for that matter. could you tell me where to do so...i apologize for the ignorance


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