Every "n" ticks block
-
Is there a way to achieve the following: instead of running ea every "n" ticks and then not again for another "n" ticks, run ea every "n" ticks and check every tick thereafter until conditions are met/order is opened and then (once condtions met to open order) check again in another "n" ticks?
-
I think if you put this block below the condition, it will work that way, because this block counts ticks only when it is executed. And if you want you can also play with the counters (category Counters)
-
hmm, can't figure it out. Basically, if conditions are met and "n" ticks have passed, then buy order. But if conditions are not met and "n" ticks have passed, keep checking conditions every tick until conditions are met and then buy order. If I put every "n" ticks block under conditions, then it is not exposed to tick flow and does not count every tick. Not sure if counter could help here.
Here is the logic in steps:
meets conditions?
open position
wait n ticks before running again
on nth tick, check condtions again. meets conditions?
open another position
doesn't meet conditions?
keep checking conditions every tick until conditions satisfiedMaybe this can't be accomplished without custom programming?
Thanks
-
__If I put every "n" ticks block under conditions, then it is not exposed to tick flow and does not count every tick. [/quote:3lxr2via]
It is, while the condition is true. Then it stops.But there are also counters - a block that incremets itself every time when it is executed ("Count n, then pass" - if it is on the top, it actually count ticks and starts to pass after n ticks counted) and a block that can reset that counter by ID (you can reset it after Buy now/Sell now, so after a trade is placed - the counter starts to wait for n ticks again.
-
ok, thanks for that information. Based on that, I built this but something isn't working correctly: http://fxdreema.com/shared/aZn6u8Chc
-
Block 27 - group is 0 (empty). In the other blocks it is 500.
-
good catch, thanks. It's working great now except... buy order should open on first tick (if no trade is running) but it doesn't. I removed all the conditions and still no luck: http://fxdreema.com/shared/e9c2qnaNb
Any ideas?
-
I don't know, on my backtester there are many buys. You are trying wrong EA file?

-
I am also getting a lot of buys on my backtester but, based on the ea blocks, shouldn't there be a buy within the first bar if not the first few ticks? If no orders running, open buy position. Even if you take the conditions away, it doesn't open a buy order on the first tick.
-
figured it out... block #28 adjust value was too restrictive. Increased it to 0.0001 and now it's working as expected

-
I have it on the first tick. Even if I put the visual mode to pause (">>") a buy trade appears.