Using #property indicator_chart_window

 

can I use

#property indicator_chart_window

in an EA, and if not why not and what do I have to do in its place / do to make it work ?

I have copied it from a Pivots_daily indicator where it already draws to the main window so why will it not work when being used in an EA ?

(in laymans terms please :-) )

 

there are indicators and EAs.

they work differently

Indicators ... indicate (either in chart window or separately)

EAs .. don't indicate (although the strategy tester can show indicators that the EA uses)

 

ok, but the indicator I am taking the code from draws to the main window, it is the daily pivots indicator.

why does #property indicator_chart_window work in the indicator but not in the EA, and if this is the case is there another way I can draw the same from within the EA ?

 

becuase #property indicator_chart_window is emant EXCLUSIVELY for indicator usage.

Why not just plant indicators to the chart and use iCustom(); command to access contents?

 
forexCoder:

becuase #property indicator_chart_window is emant EXCLUSIVELY for indicator usage.

Why not just plant indicators to the chart and use iCustom(); command to access contents?


Yes, it does appear that way, but I am asking if anyone knows why AND if there is an alternative that I can use within the EA itself.

I dont know how to use iCustom yet, but I will learn now, thankyou.

 

Because it was created that way ? :)))

Alternative is to simply leave these things as indicators for your chart if you want to see it when EA works.

Then use iCustom command to acces the same data that the indicator is drawing, link to iCustom. Use it from your EA.

 
  1. EA's don't need indicators on the chart. They get their values from iCustom.
  2. If you add the indicators to the chart for your use, then you must make sure you always have the parameters match what the EA is using.
  3. Otherwise, have the EA draw the lines
 
thanks guys that is really helpfull. will live with not knowing why until another life :-) but thanks for the advice and the links.
 

To properly understand why, you first have to learn the difference between an indicator and an EA, if you can learn that you will be able to live with knowing why in this life as well as another lol