The value that is returned by the function you are calling is iRetTlBreak . . .
So do this . . .
int testsignal = fnGetTrendLineSignal(trendline_name, trendline_type);
then testsignal will have the value that the function returned, i.e. iRetTlBreak
Add this line after the function call . . .
Print ("testsignal = ",testsignal);
And you will see that iRetTlBreak and testsignal have the same value.
The value that is returned by the function you are calling is iRetTlBreak . . .
So do this . . .
then testsignal will have the value that the function returned, i.e. iRetTlBreak
Add this line after the function call . . .
And you will see that iRetTlBreak and testsignal have the same value.
hi there Raptor
i have tried that before and no result
here is what I have tried right now and it does not print for me so
you will see that the "testsignal" does not appear in the journal
am I missing something ?
iRetTlBreak is printing fine and is working fine
but nothing from the testsignal print statement
// call the i have used other ideas to get the functin to work this gets it work but i cant get an output int testsignal = fnGetTrendLineSignal(trendline_name, trendline_type); Print ("testsignal = ",testsignal); // if (fnGetTrendLineSignal(trendline_name, trendline_type) == 1) // return(0);
am I missing something ?
iRetTlBreak is printing fine and is working fine
but nothing from the testsignal print statement
You did something wrong . . . .
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: testsignal = 0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: iRetTlBreak = 0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: m = -0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: y1 = 161.0374
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: x1 = 1203519600
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: testsignal = 0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: iRetTlBreak = 0
You did something wrong . . . .
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: testsignal = 0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: iRetTlBreak = 0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: m = -0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: y1 = 161.0374
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: x1 = 1203519600
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: testsignal = 0
2011.12.05 09:10:21 2008.03.03 03:24 trend-line-test EURJPY,H1: iRetTlBreak = 0
I got it to print on a live account
but it still not show in the tester ?
I got it to print on a live account
but it still not show in the tester ?
Yes it is . . . I ran it in the Strategy Tester
my code works too:
int checkTrendBreak(int type,double bid,double ask)//type 0==downtrend (above candles) and type 1==uptrend (below candles) { datetime date1 =D'12.01.2024 20:00:00'; datetime date2 =D'18.01.2024 16:00:00'; double price1 = 0.67422; double price2 = 0.65190; int iRetTlBreak = 0; double x1 = (double)date1; double y1 = price1; double x2 = (double)date2; double y2 = price2; // calculate the slope of the line (m) double m = (y2-y1)/(x2-x1); // calcualte the offset (b) double b = y1 -m*x1; // get the current x value double time = TimeCurrent(); // calculate the value (y) of the projected trendline at (x): y = mx + b double value = m*time + b; if( type == 0 )// Print ("type = ",type); if( bid > value )iRetTlBreak = 2; if( type == 1 )// Print ("type = ",type); if( ask < value )iRetTlBreak = 1; return iRetTlBreak; }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi i have been trying to adapt this code to my ea
so I have got it to find a trend line drawn by me on the chart
no it not my code just my adaption of the code
the function works and produces the desired result
however i can figure out how to get the result out of the function
that is i cant get it to where i can use hte information elswhere in the ea
any suggestions would be most appreciated
Thanks