Basket SL & TP within a single chart

User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

Basket SL & TP within a single chart

Post by traderduke »

Rene
Thanks, I'll get on it first thing Sunday. I'll add the snippet to BnG v1z and place it on 12 HI charts.
I noticed at least 5 other members asking for the same thing on Basket EA's on this forum.

Again Thanks

Ray
Louisetano
Trader
Posts: 68
Joined: Thu Jan 01, 2015 9:42 am

Basket SL & TP within a single chart

Post by Louisetano »

Hi Ray,

I for one am very interested in knowing how it works out. I'm trading HGBnG live on H1 and at the moment have some pairs in DD. I'll like to keep them open, but they are far off from closing a combined basket. However if I let the EA open a few more pairs with potential of closing individual baskets it would help the overall picture and give my losing pairs time to dig themselves out of a hole ;)

So thank you and please let us know how it goes. It would be great to have this extra feature to play with :good:

:)
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

Basket SL & TP within a single chart

Post by traderduke »

Louisetano » Sat Jun 11, 2016 1:23 am wrote:Hi Ray,

I for one am very interested in knowing how it works out. I'm trading HGBnG live on H1 and at the moment have some pairs in DD. I'll like to keep them open, but they are far off from closing a combined basket. However if I let the EA open a few more pairs with potential of closing individual baskets it would help the overall picture and give my losing pairs time to dig themselves out of a hole ;)

So thank you and please let us know how it goes. It would be great to have this extra feature to play with :good:

:)
Louisetano

Here is the reason for the Basket PL/SL
2016-06-12_081638-reasoh for basket PT_SL.png
I believe this Basket could be useful in all multi symbol, grid trade EAs.

Ray
You do not have the required permissions to view the files attached to this post.
windorz
Trader
Posts: 62
Joined: Thu Mar 17, 2016 6:41 pm

Basket SL & TP within a single chart

Post by windorz »

Hi

This one can be used for your purpose ?

http://www.stevehopwoodforex.com/phpBB3 ... =87&t=3966

Holy Graily Bob's Basket Manager.mq4

◦ BasketCashSl: the individual pairs' basket of trades closes when their combined
loss hits this cash total.
◦ BasketCashSlPercent: the individual pairs' basket of trades closes when their
combined loss hits this percentage of balance figure.
◦ BasketCashTp: the individual pairs' basket of trades closes when their combined
profit hits this cash total.
◦ BasketCashTpPercent: the individual pairs' basket of trades closes when their
combined profit hits this percentage of balance figure.
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

Basket SL & TP within a single chart

Post by traderduke »

renexxxx » Fri Jun 10, 2016 4:14 pm wrote:
I have attached some snippets of code that you can use for this purpose:

In a nutshell, assuming that each single-chart EA (that opens multiple symbols and multiple of the same symbol), has a unique MagicNumber:
  • First get the list of unique open symbols
  • For each symbol in that list
    • Determine its "symbol-specific" basket profit
    • If that basket profit exceeds a given BasketTP or BasketSL, close that basket
That's all to it. I haven't tested the attached code as that is your job.

Have fun.
Rene
What better time to test a basket, GPB went wild but failed. My SL was -100.

See attached: charts and EA I used.

Thank you

Ray
6-13-2016 10-17-02 AM-basket-failure.png
Holy Graily Bob 'n Grid v1z H1-BasketTpSl.mq4
You do not have the required permissions to view the files attached to this post.
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

Basket SL & TP within a single chart

Post by traderduke »

windorz » Sun Jun 12, 2016 1:40 pm wrote:Hi

This one can be used for your purpose ?

http://www.stevehopwoodforex.com/phpBB3 ... =87&t=3966

Holy Graily Bob's Basket Manager.mq4

◦ BasketCashSl: the individual pairs' basket of trades closes when their combined
loss hits this cash total.
◦ BasketCashSlPercent: the individual pairs' basket of trades closes when their
combined loss hits this percentage of balance figure.
◦ BasketCashTp: the individual pairs' basket of trades closes when their combined
profit hits this cash total.
◦ BasketCashTpPercent: the individual pairs' basket of trades closes when their
combined profit hits this percentage of balance figure.
windorz
I'll give it a try but I don't think it works that way

Thanks
Ray
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

Basket SL & TP within a single chart

Post by traderduke »

Rene
I know your busy with your new EA G&G. When you get a chance could you check to see what I have wrong in my addition of Basket TP SL. The recent volatility certainly shows the need for this option. I put separate magic numbers, 1-12, for each symbol/chart.

Thanks for your interest

Ray

See attached chart and EA
6-16-2016 7-46-02 AM-basket-2.png
Holy Graily Bob 'n Grid v1z H1-BasketTpSl.mq4
You do not have the required permissions to view the files attached to this post.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

Basket SL & TP within a single chart

Post by renexxxx »

This request got somehow snowed under.

The "Holy Graily Bob 'n Grid v1z H1-BasketTpSl.mq4" EA is clearly a single-symbol EA. It may open multiple trades of the same symbol (all with the same MagicNumber), but it will won't ever open trades for a different symbol. Therefore the CheckForClosures() function should just be:

Code: Select all

void CheckForClosures() {

   if(!UseBasketPair) return;
   
   double basketProfit = BasketProfit( _Symbol, MagicNumber );
   if ( ( basketProfit > BasketTP ) || ( basketProfit < BasketSL ) ) {
      CloseBasket( _Symbol, MagicNumber );
   }
}
The code snippets I suggested earlier, were meant for one multi-symbol controller EA that would check all symbol-specific baskets to see if they would have exceeded a given BasketTP or BasketSL. As the basket code has been added to a single-symbol EA (each installed on a different symbol/chart), we only need to worry about that symbol (i.e. _Symbol).

Hope this helps. I have attached the modified "Holy Graily Bob 'n Grid v1z H1-BasketTpSl.mq4".

Cheers ...
You do not have the required permissions to view the files attached to this post.
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

Basket SL & TP within a single chart

Post by traderduke »

Rene
I'll test it!

Thanks a million, I hope
Ray
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

Basket SL & TP within a single chart

Post by traderduke »

Rene
I've tested it each and every way but no Basket action each with as low as 20 &-20 to 50& -50 . I tried Basket only see GBPCAD tradereport. I tried basket with atrTP, BE & JS but no basket action.
I had noticed that the error 4200 was showing up when ever the UseBasketPair was false, so I took out the " // if(!UseBasketPair) return;" at 6593 and that stopped the error 4200. Apparently a false "return" was running the buttons again. I don't know what the correct syntax should be.

Let me know what you think.

Ray
6-20-2016 11-05-15 PM-gpbcad-basket only.png
6-20-2016 3-45-07 PM-basket-usdjpy.png
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Coders Hangout”