My Grid type EA project
-
How to do this:
- If there is a buy trade and the price go against me in 10 pips, add another buy...and so on and on.
- Let says the markets go against me and opened 20 trades, but the market is now retracing. I want to close with 5 pips of profit(not money) of these 20 trades.
-
You may search the forum for "grid" or "grid trading" or "averaging" and you'll find many great answers....
-
I did but i can't find what i am looking for?
-
-
Here is the "Buy Pending orders in grid" you said:

Thank you but that is not what i am looking for. It does not place order at market price and it place orders at the wrong side. Also I don't really want to use pending order.I think i need to do it another way manually :
Buy at price level, if against me X pips then Buy again with same lot size. Take profit is averaging 5 pips profit of all Buy orders. Just that, help me please. -
You can flip the grid by putting negative Grid size.
If you want to do it manually,
- when a trade is opened, store the price to some variable lastprice
- formula: candle price - lastprice
- condition: formula result is above X pips
- open trade, change the price variable.
I'm not sure about the average 5 pips closing, as I use netting system myself. I guess you can do it with the bucket of trades -block.
-
Thanks but sorry, I think i am totally stuck, not sure what to do now.
Actually I want to create a random direction Grid ea: Buy or Sell if no trade, if price go against me then add more trade, just that.
See this: https://fxdreema.com/shared/qCQmByUfb -
since there is no more help, i am willing to pay $10 to anyone who can help me to finish my EA.
-
https://fxdreema.com/shared/OG5F0mdB
Here's the core grid system as you described.You can just open this into a new tab and then copy all blocks to your new project.
Remember to set constants and variables like this:


-
Hello roar, thank you so much for your help! The money will be yours.
What if I want the EA start a random trade immediately after I attached the EA to the chart? Because I see that you are dealing with candle IDs, in this EA only price level should matter i think, why candle ID?
-
Oh, yes, I used the candle ID in just one block, others are id 0.
That one block is meant for randomization; it compares upper wick of candle 55 to candle 67 or something, the outcome is very random (50:50 buys and sells). That condition can of course be something else as random, or perhaps some custom random function.
Personally I would trade in direction of some long period moving average, its not random and its not perfect trading analysis, but it is something in between...The ea will trade instantly you run it.
-
Sir thank you for your work, I renamed variables and constance, and did some other changes. Here is my version:


https://fxdreema.com/shared/Ve9B1sI2cNow it is just missing the take profit, I want averaging TP of all trades in pips.
-
https://fxdreema.com/shared/jX8wezXxc
This seems to work. I see fxdreema has implemented some nice new blocks, makes things easier

