How to make EA open a trade when the indicator draws an arrow?

 

Hello, I have a indicator named "arrow.ex4". I have only managed to do this:


#resource "\\Indicators\\arrow.ex4"

void OnTick()
  {

      double value=iCustom(_Symbol,_Period,"::Indicators\\arrow.ex4",1,1);
   
  }  


but how can I detect the arrows it draws? When I backtest the EA after I press stop the arrows appear on the chart so this means that it works. 

 
Boris Georgiev Anchev: but how can I detect the arrows it draws?
  1. Only you know whether buffer index one is correct.
  2. You read the value. It will either be a price or it will be EMPTY_VALUE. Test for it.
  3. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

 
Boris Georgiev Anchev:

Hello, I have a indicator named "arrow.ex4". I have only managed to do this:



but how can I detect the arrows it draws? When I backtest the EA after I press stop the arrows appear on the chart so this means that it works. 

you did the important part you calculated the value of your indicator so now you need to compare it with the price lets say the Close price of the candle it will be like this :

if(Your-value <= Close[1]) //it means if the arrow <= the Close Price of the First candle
{
SELL or BUY
}
 
themasterx7:

you did the important part you calculated the value of your indicator so now you need to compare it with the price lets say the Close price of the candle it will be like this :

if(Your-value <= Close[1]) //it means if the arrow <= the Close Price of the First candle
{
SELL or BUY
}

What on Earth are you talking about???

 
Keith Watford:

What on Earth are you talking about???

He Asked a question I answered him !! What's wrong with my answer ?  

 
themasterx7:

He Asked a question I answered him !! What's wrong with my answer ?  

The answer appears to be nonsense to me.

 
Keith Watford:

The answer appears to be nonsense to me.

I get that you didn't like it but still you didn't answer my question instead you keep saying its nonsense and didn't give an answer of your own.

 
themasterx7:

I get that you didn't like it but still you didn't answer my question instead you keep saying its nonsense and didn't give an answer of your own.

I don't keep saying that your answer is nonsense, I said that it appears to be nonsense to me once.

William Roeder already gave the answer. Usually, with an arrow type indicator if the iCustom call returns EMPTY_VALUE, it means that no arrow is drawn on that bar, any other value will mean that an arrow is drawn for that buffer on the relevant bar. Nothing to do with Close[1].

  • William Roeder:You read the value. It will either be a price or it will be EMPTY_VALUE. Test for it.
 
Keith Watford:

I don't keep saying that your answer is nonsense, I said that it appears to be nonsense to me once.

William Roeder already gave the answer. Usually, with an arrow type indicator if the iCustom call returns EMPTY_VALUE, it means that no arrow is drawn on that bar, any other value will mean that an arrow is drawn for that buffer on the relevant bar. Nothing to do with Close[1].

Its ok you will be right if it  returns EMPTY_VALUE but you said Usually, I thought it has a value that's why I answered the answer you saw above .

Good Talk... and I'm sorry if made you uncomfortable .  

Be Safe

 
Boris Georgiev Anchev:

Hello, I have a indicator named "arrow.ex4". I have only managed to do this:



but how can I detect the arrows it draws? When I backtest the EA after I press stop the arrows appear on the chart so this means that it works. 

Hello,

Just drag your indicator on a chart, open Data Window (ctrl+D) and check first if your indicator have accessible buffer to read.

Reason: