How to skip 1st trade signal?
-
Hi. I'm testing few MACD settings for EA.
The problem is, how can I skip trade for first signal when the signal line crosses main line from either above or below 0 level in MACD. -
@biztet what do you mean by first signal? The first trade when you run a backtest?
Or do you mean to skip the crossing candle and only trade when its confirmed?
-
Hi roar. Let's say on macd have multiple line crossing during downtrend or uptrend. I just don't want to trade on the first cross.
*multiple crossing above 0 level or below 0 level.
-
@biztet Ok, so to formalize the problem:
- if macd has been rising or falling for n continuous bars, dont trade cross
- if macd has been rising or falling for less than n continuous bars, trade the cross
-
https://fxdreema.com/builder/shared/Ywd5JdNdb
This one buys the 2nd and later crosses when 1st cross has happened after 15 candles of negative macd.
-
It's like this picture.
Blue circle is first signal when macd above 0 level. I want to skip the blue.
And the greens are 2nd&3rd signal that will open trade.
-
@biztet ah, I see. That case is simplier:
https://fxdreema.com/builder/shared/09jozbiRd
-
Great roar, thanks.
I just wondering why it doesn't open a trade during backtest..
I only duplicate it and reverse the signal for sell.. -
@biztet To get sell trades, just replace the buy block with sell block and leave other blocks as they are.
To make sure everything is copied 1:1, you can use 2 browser tabs and literally copy-paste the blocks all at once. -
wouldn't it be like hedging then?
i did like you guide me to but some part its hedging,
and no trade when macd level below 0.
but when i change 1 block with condition < 0, no trade at all. -
@biztet said in How to skip 1st trade signal?:
wouldn't it be like hedging then?
i did like you guide me to but some part its hedging,Well, I dont know your strategy and what kind of system you want to build.
and no trade when macd level below 0.
but when i change 1 block with condition < 0, no trade at all.I designed the system this way. You must somehow tell the computer when a new series of trades begins. The code doesnt understand if you just say "first trade", there is only one first trade in all eternity. I solved this by setting the > 0 rule, but there are other options as well.
-
Could you please explain the function of
Counter : Reset ?
Counter : Count n pass ?
How it works? -
The EA code is run on every new tick, again and again. Once per bar restricts the flow to one tick per bar.
Now, if all its above conditions are true, the counter block increases its internal counter (0,1,2,3,4....)
In this case, the counter block counts only 1 tick (one bar and one macd cross because our conditions) and passes the next time, because it has reached the number 1.The reset block is just for cleaning up unwanted effects, because the counter doesnt care if there's a million bars difference between the count increases.
I don't know if my explanation helps any bit, I'm too tired to think straight lol
-
Much Better!
So i understand here that the Counter Reset is not really necessary, right?
Now i get it. Thank you so much for the explaination.I have another question. Still thinking of catching the news candle.
Is there any way we can set this,
within 1sec/2sec from open candle, if the pips away from open price let say more than 5pips,
then we open trade.
Buy if the price > open price
Sell if the price < open price
and close trade on new candle.If possible i want to try this.
I have tried Seconds filter + pips away from open price,
but seems not catching any. -
@biztet said in How to skip 1st trade signal?:
Much Better!
So i understand here that the Counter Reset is not really necessary, right?Well, the system has to know when the "trade streak" ends and new one begins. If you dont reset it, the EA will skip first macd cross and then trade every other cross for the next million years. I guess that's not what youre after here?
I have another question. Still thinking of catching the news candle.
within 1sec/2sec from open candle, if the pips away from open price let say more than 5pips,
then we open trade.
Buy if the price > open price
Sell if the price < open price
and close trade on new candle.By using the second filter and the counter blocks, this should work:
https://fxdreema.com/shared/FyO3ZKGod -
Hi roar, i'm just back from my parents house.
And just a few minutes back doing backtest using "your EA".
It seems like you've just make me a BONUS EA!
Thanks a lot. I'm going to start FT this week. Thanks again.