Getting EAs to Ignore: O,H,L,C data and trade signals & React and Respond Stirictly to Indicatiors ONLY when it switches to a new bar?

 
Greetings to One and All,
I'm trying to get an EA to react and respond strictly to indicators and ignore the Opening, High, Low and closing points on bars/candles.
Can this be done? If so: how ?

Thanks to any and all for any assistance in this matter! (< 8)
 

You dont have to reference OHLC data - just write your code to fetch values of indicators
-BB-

 
BarrowBoy:

You dont have to reference OHLC data - just write your code to fetch values of indicators
-BB-

Hi BB,
I do this, but when the incoming info is processed in the EA, it automatically monitors and reacts to Highs and Lows and triggers actions that I do not want. For example: if it hits a high or low point that triggers a Take Profit or StopLoss based on this info that I do not want. I want the EA to only react and act on iMAs. While it is quite understandable why it would be this way, in this case it is rendering my intended approach and EA completely ineffective
 
Write your own EA
 
WHRoeder:
Write your own EA

Hi WH Roeder,

I am, but the terminal still responds to and trades with the data within the bars, Highs, Lows ec that triggers TP & Sl that I don't want it to at times that I do not want it to.

I'm trying to get it to only respond to the indicators ONLY at the change of the intervals on the chart: bars, candles etc.

But it keeps reacting and responding to these High & Lows as it encounters and acts on TP & SL within and during the bars and not from the indicators that I want it to only at the changing of the bars.

Regards

 
Bar 0 forms as new ticks come in. A new tick gererates a new close for bar 0 and may also produce new highs or lows and your indicators will re calculate accordingly. Your EA will react to the indicator as currently calculated but a second later your indicator will re calculate based on the next tick. It only becomes static (most indicators but not all) at the completion of the time frame. If you want static indicator values, you need to reference the previous bar, Bar 1. Set the shift on your indicator to 1 and it will ignore all revised calculations of the indicator until the next new time period starts.

I hope I've understood you correctly and hope that helps
V
 
Viffer:
Bar 0 forms as new ticks come in. A new tick gererates a new close for bar 0 and may also produce new highs or lows and your indicators will re calculate accordingly. Your EA will react to the indicator as currently calculated but a second later your indicator will re calculate based on the next tick. It only becomes static (most indicators but not all) at the completion of the time frame. If you want static indicator values, you need to reference the previous bar, Bar 1. Set the shift on your indicator to 1 and it will ignore all revised calculations of the indicator until the next new time period starts.

I hope I've understood you correctly and hope that helps
V

Hmmm.

By & large I am using previous bars, but I do have a couple using the opening price of the new bar '0'. But I can use the closing price of bar 1 instead.

This may hep with part of the problem, but as the TP & SL is always there at a price. Theses prices are set and they trigger the TP or SL regardless in the current bar.

 
Viffer:
Bar 0 forms as new ticks come in. A new tick gererates a new close for bar 0 and may also produce new highs or lows and your indicators will re calculate accordingly. Your EA will react to the indicator as currently calculated but a second later your indicator will re calculate based on the next tick. It only becomes static (most indicators but not all) at the completion of the time frame. If you want static indicator values, you need to reference the previous bar, Bar 1. Set the shift on your indicator to 1 and it will ignore all revised calculations of the indicator until the next new time period starts.

I hope I've understood you correctly and hope that helps
V

double iMAOnArray may do it ?

But I think that it can & will trigger the TP & SL as new ticks come that reach those values




 
TP and SL are wholly dependent on price. Indicators will have no influence on them. If a tick reaches them, they will be triggered. You can of course modify those levels at any time (within allowable distance). You could set a wider SL / TP and close the trade based on your indicators though... is that what you mean?
 
Hi Viffer,

TP and SL are wholly dependent on price. Indicators will have no influence on them. If a tick reaches them, they will be triggered. You can of course modify those levels at any time (within allowable distance).

Yes, this much I know.

You could set a wider SL / TP and close the trade based on your indicators though... is that what you mean?

No, I want to find a way for the trade to ignore the OHLC entirely and ONLY be acted on the indicators that I am using in the EA.

ReReading this before posting:This may be a 'work around' to achieve what I want. The EA doesn't set a TP nor a SL on the broker's server when it places an order. I'll be on a ECN/STP broker in a while and from what little experience I have with their methodology, one CAN'T place a TP nor a SL when opening a new trade with them anyway.

But the indicator is still going to act upon the price level, otherwise in most cases, what good would it be?

But it certainly is possible to calculate and set activation points with the EA and not utilize the brokers TP/SL at all. Even in my very limited experience I've encountered a number of EA's that work this way.

The thing that concerns me with this methodology is that should my MT4 client loses communication with the server, then the trade is free to take huge losses ( & profits).

I could set REALLY wide TP/SL points as 'insurance' for these circumstances and then have the EA with the indicators control the trading activity entirely though.

Thanks

 
Viffer:
Bar 0 forms as new ticks come in. A new tick gererates a new close for bar 0 and may also produce new highs or lows and your indicators will re calculate accordingly. Your EA will react to the indicator as currently calculated but a second later your indicator will re calculate based on the next tick. It only becomes static (most indicators but not all) at the completion of the time frame. If you want static indicator values, you need to reference the previous bar, Bar 1. Set the shift on your indicator to 1 and it will ignore all revised calculations of the indicator until the next new time period starts.

I hope I've understood you correctly and hope that helps
V

Hi Viffer,

I haven't been able to get any other approaches to work reliably and I can see the wisdom of your approach, especially as I am using longer interval charts. I'll try utilizing the close of bar 1 instead of the opening of bar 0.

Thanks for the suggestion