stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Basket SL & TP within a single chart
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4698
Page 2 of 4
Author:  traderduke [ Sat Jun 11, 2016 3:22 am ]
Post subject:  Basket SL & TP within a single chart

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
Author:  Louisetano [ Sat Jun 11, 2016 6:23 am ]
Post subject:  Basket SL & TP within a single chart

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:

:)
Author:  traderduke [ Sun Jun 12, 2016 12:31 pm ]
Post subject:  Basket SL & TP within a single chart

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
Author:  windorz [ Sun Jun 12, 2016 6:40 pm ]
Post subject:  Basket SL & TP within a single chart

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.
Author:  traderduke [ Mon Jun 13, 2016 2:47 pm ]
Post subject:  Basket SL & TP within a single chart

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
Author:  traderduke [ Mon Jun 13, 2016 3:25 pm ]
Post subject:  Basket SL & TP within a single chart

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
Author:  traderduke [ Thu Jun 16, 2016 12:12 pm ]
Post subject:  Basket SL & TP within a single chart

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
Author:  renexxxx [ Fri Jun 17, 2016 9:08 am ]
Post subject:  Basket SL & TP within a single chart

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 ...
Author:  traderduke [ Fri Jun 17, 2016 2:26 pm ]
Post subject:  Basket SL & TP within a single chart

Rene
I'll test it!

Thanks a million, I hope
Ray
Author:  traderduke [ Tue Jun 21, 2016 3:16 am ]
Post subject:  Basket SL & TP within a single chart

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
All times are UTC Page 2 of 4