Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Print values - dates only with Moving Average crossing
I coded a simple indicator to plot 3 moving averages
Then I add the condition of the first 2 crossing
I want to apply this indicator to the Radar where I have selected some values
My info extraction would be very simple at first:
- Future / Stock - Date - Value at which the 2 Moving Averages have crossed
but get data extraction only in the date in which I have a crossing, I don't need the Dates and Values without any Moving average crossing
I have managed to write the Plot part, even the Condition, but I don't know how to code the Print part
What do you intend to do with the prints? Any display in Radarscreen is done via plots, while the output of the print reserved word appears in the "EasyLanguage Print Log".
If you want to display the date in Radarscreen, you could store the date in a variable when your condition is true. Then you can plot plot this variable directly or convert it via ELDateToString and plot the string (you can also set the grid style to date for the latter under the indicator properties: Format Analysis Technique - Grid Style).
The link you included in your reponse is exactly what I want: to display the date in Radarscreen
I must be too new in coding Easy language ....Believe me I have tried to apply all that to display the date in Radarscreen when the last EMA Crossing took place.
I tried really hard in order not to be a pain in the neck to you, coming back with every single question I have, but I must admit I have not been succesful, the more things I try the worst
I believe that coding this for you must be a walk in the park ... can you help me
I would suggest checking out the reserved words "crosses over" and "crosses under". These should help you in detecting that the averages crossed. When you are able to detect this, you can save the date at the moment you detect the cross in a variable and plot this variable later.
My issues ... really appreciate your guidance on them
1. Keeps being how to store the date
//store the date of the bullish cross
if ExpAv1 crosses over ExpAv2
then begin
HaveUpCross = true;
UpCrossDay = ??? // don't know how to capture the date
end ;
2. Once we have the bullish cross Date in the past ... I want to check how it worked
Like a backtesting but forward looking ... making the most of the Radar capabilities, checking for all components of an Index)
I know how to do it backward looking (with "offset") but not forward looking
Backward looking would be ... with the Close Date
plot1(CurrentBar, "Bar Nr");
inputs: offset1(20), offset2(40), offset3(60), offset4(80), offset5(100), offset6(120); // each month has typically 20 trading days
I tried to store the date in a variable when the condition is true, using the word Date ... without success
I have managed only to work deducting days from the current one (Date [1]) … but I have not been able to link it to the crossing day of the moving averages, to store that date
I also tried to find another thread with something similar, again without success
Please can you code this for me, or give me a thread with a solution similar to the one I am looking for
PS: I was also asking how to do backtesting but forward looking ... making the most of the Radar capabilities, checking for all components of an Index
I know how to do it backward looking (with "offset") but not forward looking
Do you know what word can I use for this?
I can try to point you in the right direction, but it's hard without knowing the actual code changes that you made.
I am not sure I understand your intentions regarding forward looking. The code is generally evaluated bar by bar starting with the first bar, so you might face the problem that values in the future are not yet calculated on historical bars.