Desky. TDesk's trading drone.

Post Reply
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

Vokin » Tue Oct 23, 2018 8:49 am wrote:Hi,
i have this problem:
Setting
-- All trades belong to a single basket --
TreatAllPairsAsBasket = true
BasketTargetCash = 50
Now the cash is higher than the set, but the basket is not closed.
Problem as always with my old eyes?
Thanks for answer.
I should have realised the feature wasn't working when I closed the position manually on Friday - blame The Flatulent Beauty And Her Sodding Beast.

None of the global basket stuff is working in 1k because I forgot to add the code that holds the totals - fixed in 1l.

Easy fix for the DIYers. Do a search for "CashUpl = 0;//For keeping track of the cash cash Upl of multi-trade/hedged positions" and insert this underneath:

Code: Select all

   //Global basket trading
   TotalPipsUpl = 0;//Global pips total
   TotalCashUpl = 0;//Global cash total
Then do a search for "if (!BetterOrderSelect(cc, SELECT_BY_POS, MODE_TRADES) ) continue;" This will be around line 978/9ish.
Insert this code block underneath:

Code: Select all

      //Global basket trading
      if (TreatAllPairsAsBasket)
      {
         TotalCashUpl+= OrderProfit() + OrderSwap() + OrderCommission();
         pips = CalculateTradeProfitInPips(OrderType());
         TotalPipsUpl+= pips;
      }//if (TreatAllPairsAsBasket)
It MUST GO above "//Ensure the EA 'owns' this trade"

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

I just thought of an extra conditional that can be added to the second block of code:

Code: Select all

      //Global basket trading
      if (TreatAllPairsAsBasket)
      {
         TotalCashUpl+= OrderProfit() + OrderSwap() + OrderCommission();
         if (OrderType() < 2)
         {
            pips = CalculateTradeProfitInPips(OrderType());
            TotalPipsUpl+= pips;
         }//if (OrderType() < 2)
      }//if (TreatAllPairsAsBasket)
All the extra conditional does is force the routine to include only market orders. This does not matter much as stop and limit orders will have zero upl values.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
Vokin
Trader
Posts: 50
Joined: Tue Dec 06, 2011 4:31 pm

Desky. TDesk's trading drone.

Post by Vokin »

You are quick.
Now I.
Fixing code, compiled, cleared variables, run EA, without success.
Dload your 1l, compiled, cleared variables, run EA, without success.
:arrrg: :arrrg:
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

Vokin » Tue Oct 23, 2018 12:37 pm wrote:You are quick.
Now I.
Fixing code, compiled, cleared variables, run EA, without success.
Dload your 1l, compiled, cleared variables, run EA, without success.
:arrrg: :arrrg:
You have no profit targets displayed on your screen, so you do not have any set. That one is down to you.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
Vokin
Trader
Posts: 50
Joined: Tue Dec 06, 2011 4:31 pm

Desky. TDesk's trading drone.

Post by Vokin »

Now i really dont now what is wrong.
TreatAllPairsAsBasket = true
BasketTargetCash = 100
What I need to set up for Basket TP?
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

Vokin » Tue Oct 23, 2018 2:18 pm wrote:Now i really dont now what is wrong.
TreatAllPairsAsBasket = true
BasketTargetCash = 100
What I need to set up for Basket TP?
It is not you Vokin. I had Desky using a dynamic cash TP so my screen was showing a target. It stopped doing so as soon as I canceled the dynamic TP and used BasketTargetCash.

BasketTargetCash is getting reset to 0 somewhere. I will post when I find it. For now, set a dynamic TP.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

Found it. There are a couple of variables concerning the Friday reducing basket TP figure that I had declared but not populated. Fixed in 1m in post 1.

Easieast DIY yet, I reckon. Do a search for, "return(INIT_SUCCEEDED);" and insert this code just above - about line 610ish:

Code: Select all

   OriginalBasketTargetCash=BasketTargetCash;
   OriginalBasketTargetPips=BasketTargetPips;   
:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
Vokin
Trader
Posts: 50
Joined: Tue Dec 06, 2011 4:31 pm

Desky. TDesk's trading drone.

Post by Vokin »

Sorry Steve.
TP is now visible, but the basket is still not closed.
Its not big problem for me, i can use your MPTM.
Regards V.
You do not have the required permissions to view the files attached to this post.
User avatar
Vokin
Trader
Posts: 50
Joined: Tue Dec 06, 2011 4:31 pm

Desky. TDesk's trading drone.

Post by Vokin »

Its cool thisMT4.
Now i dont see nothing here, but EA close and open repeatedly USD/JPY. :o
You do not have the required permissions to view the files attached to this post.
User avatar
Dragonian
Trader
Posts: 129
Joined: Thu Aug 20, 2015 3:17 pm
Location: Wales

Desky. TDesk's trading drone.

Post by Dragonian »

Vokin » 24 Oct 2018 13:18 wrote:Its cool thisMT4.
Now i dont see nothing here, but EA close and open repeatedly USD/JPY. :o
I found that if I entered a basket take profit lower than that which had already been achieved then the graphic would disappear, as in your image. Put in a take profit amount higher than currently shown and it should re-appear.

My basket's still don't close when target hit though.
TTFN

Bill
Post Reply

Return to “TDesk: A Thomas Special. The greatest trading tool ever.”