Forex Zone - Forex Forum

Basket Scalper EA

Discussion started on EA Modifications

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
Hi. I have an EA that I need to make changes to. Right now it opens buys when the price falls according to the order step setting. It sells when the price rises. Can you please put a setting in the EA so that there is an option to make it work in reverse. It will open buys as the price rises and it will keep placing sell trades as price falls. For example let's say price is 1.13900 and the step is set at 5 pips. Then when price goes to 1.13950 it will open up another buy order. It will keep doing this. Same for sells. When the take profit is hit please make it close all trades at one time as a basket. Hedging is needed for this EA to work. Also lets say there is a buy order open and the price reverses down. The ea will keep those buys open and start opening sell orders according to the step. I hope this can be done. Thanks.

Linkback: https://www.forex.zone/ea-modifications/17/basket-scalper-ea/658/
#1 - January 16, 2019, 11:36:48 PM
Attachments:
« Last Edit: January 28, 2019, 11:46:12 PM by Admin »
Basket Scalper EA in EA Modifications_topic=4522

Administrator
  • Hero Member
  • Posts: 5113
  • Points: 29360
  • Likes Received: 5122
  • Reputation: +220/-14
I will be looking into this as soon as possible.
#2 - January 17, 2019, 12:21:28 AM

Basket Scalper EA in EA Modifications_topic=585

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
Ok thanks alot admin!
#3 - January 17, 2019, 12:44:44 AM

Administrator
  • Hero Member
  • Posts: 5113
  • Points: 29360
  • Likes Received: 5122
  • Reputation: +220/-14
Will buys and sells be considered as separate baskets? Or will both types of trades be considered in a single basket?
#4 - January 17, 2019, 01:15:56 AM

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
When profit is reached all trades are closed down at the same time as a single basket.
#5 - January 17, 2019, 01:29:51 AM

Administrator
  • Hero Member
  • Posts: 5113
  • Points: 29360
  • Likes Received: 5122
  • Reputation: +220/-14
What might happen though is a scenario like this. Let's say the EA places 3 buy trades and price doesn't quite reach the TP. Then the market reverses down to the point where it can start placing sell trades. All the 3 buy trades are in negative now. Which means the market really has to move down for the sell trades to overtake the negative buy trades loss. You can either run out of margin this way. Or the market can get stuck in a range and neither side takes profit for a long time. Because of your strategy, even a large range would be enough for this EA to come to a stand still with profit never being reached for a long time.
#6 - January 17, 2019, 02:31:27 AM

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
I think if the tp is set to a low amount like 5 pips and a step of 5 pips this would not happen. The market won't stay in a small range forever, eventually price has to move either way. 
#7 - January 17, 2019, 02:41:27 AM

Administrator
  • Hero Member
  • Posts: 5113
  • Points: 29360
  • Likes Received: 5122
  • Reputation: +220/-14
With the settings you just said, I don't think there ever would be a basket though.

Also, since both buys and sells will be considered in a single basket, the range I mentioned doesn't have to be small. It could actually be a large range and the EA will come to a stand still because TP is never reached.
#8 - January 17, 2019, 03:19:58 AM

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
What if you added a max trade setting to limit the amount of trades. That would prevent it from adding too many trades which might blow an account. If the tp was 5 pips and the step was 5 pips it would eventually get profit and close all trades in profit. If it gets caught in a range maybe with a max trade of 3 or so would cut down on drawdown. When max trades is reached maybe have the ea start the process over once price has moved x number of pips above the highest trade or below the lowest trade. 
#9 - January 17, 2019, 03:48:05 AM

Administrator
  • Hero Member
  • Posts: 5113
  • Points: 29360
  • Likes Received: 5122
  • Reputation: +220/-14
What if you added a max trade setting to limit the amount of trades. That would prevent it from adding too many trades which might blow an account. 
I wasn't so concerned about an account blowing, but rather the EA getting stuck without ever reaching profit.




If the tp was 5 pips and the step was 5 pips it would eventually get profit and close all trades in profit. 
If the TP is 5 and the step is 5 and if the intended modification is so trades are made as the price goes in favor of the trades, then as soon as a step is ever reached, the trade would hit TP. So there would never be a basket of trades. So it wouldn't be able to close "all" trades in profit since there would only ever be 1 trade open.




If it gets caught in a range maybe with a max trade of 3 or so would cut down on drawdown. 
The drawdown would get locked up though. Let's use my example. The EA makes 3 buy trades and before hitting TP, the market reverses down. Price then reaches the point where sell trades should start being placed. Price keeps going down some so that there are now 5 sell trades. So now there are 3 buy trades in a lot of loss and 5 sell trades in profit. The sell trades profit doesn't overcome the loss from the buy side. So all trades stay open. Then price reverses up again. As long as the price stays within this range (from the highest buy order to the lowest sell order) the EA will never able to close trades since profit will never be reached. The drawdown would also be confined to a certain range too.

Unless your max trades input can be used to sort of reset the EA and start over, I just don't think it will work. Or maybe I'm missing something about the strategy.


#10 - January 17, 2019, 11:53:35 AM

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
I think there should be a max trade setting where once the ea hits the max amount of trades it stops and waits for price to go x pips above or below the highest or lowest trade. So if it was set to 3 the ea will only ever place two sells in a row or two buys in a row or it will hit tp.
#11 - January 17, 2019, 01:54:10 PM

Administrator
  • Hero Member
  • Posts: 5113
  • Points: 29360
  • Likes Received: 5122
  • Reputation: +220/-14
I think there should be a max trade setting where once the ea hits the max amount of trades it stops and waits for price to go x pips above or below the highest or lowest trade. So if it was set to 3 the ea will only ever place two sells in a row or two buys in a row or it will hit tp.
I'm not sure we are on the same page. You said "once the ea hits the max amount of trades it stops", but then your example said if it is set to 3 that it will stop after 2 trades (less than 3). So if the EA has only made 2 trades, it has not yet met the max trades.

Also, let's say the EA is using max trades and the buy side has reached the # and then price reverses down and the EA starts placing sell trades. The # of sell trades is hit too. So the EA cannot place any more trades until a TP is hit now. Well, there are 2 buys and 2 sells which means the profit/loss is locked up. The market can move a thousand pips and the EA would not be able close anything since profit would stay the same. So I am failing to see what a max trades input would solve.
#12 - January 17, 2019, 02:06:56 PM

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
The ea starts with a buy and sell open. So if max trades was at 3 it would either have 2 buys open and the sell or two sells and the buy. The max trades is counting both sides not just buys or sells.
#13 - January 17, 2019, 02:14:31 PM

Administrator
  • Hero Member
  • Posts: 5113
  • Points: 29360
  • Likes Received: 5122
  • Reputation: +220/-14
The ea starts with a buy and sell open. So if max trades was at 3 it would either have 2 buys open and the sell or two sells and the buy. The max trades is counting both sides not just buys or sells.
Ok, I get what you mean now. 

If max trades is used though, what prevents draw down or even closeouts? Let's say the max trades is 3. Price goes up to place 2 more buy orders. Then the market reverses down. No sell trades can enter since max trades has been met already. The EA will either wait for the market to go back up, if it ever does, or it will keep going down until you are stopped out. Or the market will stay in a certain range and your EA will sit there doing nothing for a while.
#14 - January 17, 2019, 02:34:30 PM

VIP
  • Hero Member
  • Posts: 1415
  • Points: 3657
  • Likes Received: 325
  • Reputation: +15/-5
In that case the ea would wait until it moved x pips below the lowest trade. There's should be a distance setting that functions only when max trades is reached. If distance is set to 20 pips it would start the whole process over once price went 20 pips below that sell. Once a new set of trades starts after price falls 20 pips the first set is left open. The first set will stay at a loss until price reverses up and it turns to profit. I know the first set will stay at a loss but the profits made by later sets of trades will balance it out. In that example there were two buys and one sell. Let's say that trade size was .01. The trades would only be in negative profit for .01 lots since there was that sell open. I'm sure that the ea will make enough profits to balance out any sets that are left open.
#15 - January 17, 2019, 03:11:35 PM

Members:

0 Members and 11 Guests are viewing this topic.