EA coding Help needed
-
@fxdreema
I saw that trade close is placed before buy now and sell now block, is that supposed to be correct? How do you close a trade you have not entered yet? https://fxdreema.com/demo/mt4-buy-sell- ... conditions -
Hi everybody,
i would like to write an EA that buys or sells when the indicator draws an arrow...
i'm not very good in writing EAs so I tried but i don't know how to do that.
can you please help me?
thank you
P.S. the indicator i'm refering to is the following
-
Try "Condition" like this:
Indicator > Value Numeric 0
Use the proper buffer, but with Candle ID bigger than 0. Indicators who draw arrows most often return EMPTY_VALUE for the current candle (where Candle ID = 0).
Note that in "Condition" if on of both sides equals to EMPTY_VALUE, the block does not pass. That's why it cannot pass if the buffer is EMPTY_VALUE.
After "Condition" you can put "Once per bar".Another way is to use "Indicator is visible" instead of "Condition". Again, with Candle ID bigger than 0.
Also, there is a block "Indicator appear", which acts a little bit differently than "Condition".
-
fxDreema
Could you please explain your comment how that "Indicator appear", acts a little bit differently than "Condition"?
Thanks
Justin -
The moment when its value turns from EMPTY_VALUE or 0 to something different than EMPTY_VALUE or 0. This is one time signal.
Condition checks 2 values. Only when crossover is used, it checks 4 values - 2 from one candle and 2 from another (older candle). But it gives continuous signals. Condition can pass on every tick until the condition is true.
-
i want to build EA on MA Cross Over...can you tell me if my buy order is executed on above MA cross over and want to close it below MA cross over and same time sell order will be executed or not.....? if not why ?
-
You are probably asking for something like this - https://fxdreema.com/demo/mt4-buy-sell- ... conditions
-
FXDremma: can u code me an EA to buy and sale basted on an indicator?
-
Normally I would not have looked at this but I thought it would have been quick enough to put something together.
There is a problem with this indicator. Although it posts blue and red arrows, there is something wrong with the coding in buffers.
I have put something in strategy tester and it only picks up the first arrow. I have tried using opposite arrows to close signals and it doesn't work so I moved on to use a close condition of of a cross of price above or below the 13 MA depending if it was a buy or a sell trigger.
It triggers the first trade and the close works but after the 1st trade, it trades no more. My programming is right. There is nothing wrong with the fxdreema or the configuration I used. For some reason, the buffers don't work correctly on the indicator.
A lot of indicators struggle to be implemented into EAs and I believe this is another case of this.
Daniel
-
Threadopener: is it still relevant?
If your indicator is really worth to be used you ask me by private message for fixing the buffers or using some other "tricks" to read the arrows for use in an EA.