Moving Day

Moving Day

Postby SteveHopwood » Sun Mar 15, 2020 2:48 pm

V 1b is in post 1, with a teensy update to the chart information display. I set up four demo accounts this morning and realised how helpful it would be to have the trading method displayed along with the number of pips away from the market the stop orders would be placed. 1b displays this information.

Easy DIY. D a search for:
sizingInfo = sizingInfo + " Single trading method is enabled. ";

Replace the entire block of code with:
Code: [Select all]
 Please Login or Register to see this content
<


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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Sun Mar 15, 2020 2:49 pm

I have created four new demo accounts that you can follow. Details in post 2.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Sun Mar 15, 2020 7:34 pm

I got 1b's upload wrong earlier - or forgot to upload it. Try again, folks.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Sun Mar 29, 2020 2:32 pm

MD took a bath last week. Newcomers will be wondering what the fuss is about. :lol: The least bad was a stop order at 20 pips. 10 pips was murdered.

I received this in an email from youcrazykids:
I’ve been watching Moving Day and its variants of late, and had some tentative thoughts on how to improve performance. Because one-third of trades are winners and two-thirds are losers, it follows that the winners should be milked for all they’re worth, and the losers should be curtailed as far as possible: 1) Scaling out could help to reduce the losses caused by losing trades, 2) When trades do head in the right direction, stacking trades in a grid (or a rolling grid) could really turbocharge the profits of these winning trades.


All this is in 1d - post 1 as usual. Scaling out is in the trade exits inputs and works as in Desky and SPCB.

There is a new input for grid trading: PendingDistanceToFirstTradePips. This is for when the first trade is a stop order and tells MD how far away from market to set the fill price. Assuming the initial trade has a take profit set, the the additional stop orders will have the same tp. All trades in the position will close at the same time.

I am going to set this up on the three demos I list in post 2. PendingDistanceToFirstTradePips will be set to 10, 15, 20 respectively. I have added a set file to post 1 to help you set up quickly and easily - "MD scale out and grid.set". This starts the grid 20 pips away from the market price, then sends four more grid trades 20 pips apart. The take profit is 100 pips and the dire emergency stop loss is 300 pips.

You can experiment with a far distant take profit, grid size, rolling grid etc. It is all in the user guide but you do not need this if you are already familiar with these functions.

Don't try to DIY unless you are very confident. Adding code like this causes me to examine existing code and I could not see how the hidden stop loss and take profit code could work properly so I made a lot of changes there, including adding Global Variables to store the hidden stops. I also spotted a couple of horrendous bloops in the sell grid order sending; I had an immediate market order set to send a buy trade instead of a sell - one of my infamous copy/paste/forgot-to-edit bloops.

There could be bugs, so sing out if you notice anything strange.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Tue Mar 31, 2020 2:07 pm

That youcrazykids' inspired idea of sending a grid of pending orders makes a huge difference became apparent today. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

1e is in post 1. MD should have sent 5 pending orders: the initial trigger order then the grid of 4. He appears to have only sent 3 in total. I am not sure if the fix in 1e will sort this out entirely. We shall see.

To apply your own fix, go to the end of:
void lookForTradingOpportunities(string symbol, int pairIndex)

Scroll up about 12 lines to the code block that sends the buy and sell grids. Replace the entire block with this:
Code: [Select all]
 Please Login or Register to see this content
<


Explanation: 'price' is either the market price if the trigger trade is an immediate market trade, or pendingDistanceToFirstTrade pips away from the market if the trigger trade is a stop order. 'price' needs adjusting when sent to the buy/sell grid functions or the first trade in the grid is not sent to avoid price duplication. Whether the fix will result in all 5 orders being sent remains to be seen.

The scale out stop loss code is working to an extent, but not as I intend. I shall look into that.

I remind you folks that Thomas has uploaded new versions of TDesk and assorted stuff. Current versions will expire tomorrow.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Tue Mar 31, 2020 3:25 pm

MD is sending 4 orders now - still short by 1. I have attempted a fix and will post it when I have redone the scaling out thingy.

For now, those of you who can, do a search for:
if(doesTradeExist(symbol,type,price))

Insert this just above the 'continue;' command:
cc--;

Repeat the search and insertion as this code needs to go into two functions.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Wed Apr 01, 2020 7:47 pm

Just to let you know folks, that I have spent much of today battling with scale out stop loss code for Moving Day. It occurred to me that it would be possible to accommodate account based lot sizing using Global Variables to store the lot size of the trigger trade. The details are proving to be a bit of a bugger. :arrrg:

More as soon as I have frightened the problems into running away.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Thu Apr 02, 2020 7:17 pm

Everyone likes a laugh at my expense.

bobier sent me a fix a few minutes ago, for a chart display thingy when the broker has a pair prefix/suffix. I was not aware of the problem as my broker is Global Prime and they do not fart around with such nonsense. Here is my reply:

Nice one Alex. Thanks. :clap: :clap: :clap: :clap: :clap:

Have a laugh at my expense. It occurred to me that Global Variables could be used to store the trigger trade's lot size so that scaling out could be applied to variable lot sizes such as lots per dollop etc.

Nothing I tried would work. The sodding GV's refused to appear. I cursed. I swore. I vowed never to touch CrapQl4 ever again. I have less hair now than I had this morning. The cats left home through terror. The birds I feed daily sat at the bottom of the garden trembling.

After several hours of frustration, I realised I had not added the code that would produce the GV's because I had not added the code that would send the trigger trade as a stop order. This also explained why the grid was always one trade short.

:arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg:

Hey ho. Updated code attached. I shall add scale back in and release it in time for market opening after the weekend.

Cheers




Scaling back in is coming. In the meantime, the attached should work properly it terms of scaling out. Don't bother trying to DIY; life is too short.

Scaling out is now independent of the stop loss. NoOfLevels tells MD how many times to apply scaling out. DistanceBetweenLevelsPips is how many pips are between scale out levels. PercentToClose is the percentage of the order to close - 25% by default.

:xm: :rocket:

EDIT: The scaling out is still not quite correct. The bot is closing the correct percentage but at 4 pip intervals not 20. Anyone here able to spot why will spare the cats more pain tomorrow:
bool scaleOutStopLoss(int ticket)
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby SteveHopwood » Fri Apr 03, 2020 1:21 pm

1f is in post 1. The glitch with the scaling out was an incorrect divisor in one of the equations.

I have added scaling back in as well. There is a quick and easy set file to turn everything on.

Everything appears to be working as intended.

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

Global Prime is the official SHF broker. Click here to sign up for a live account with Global Prime and join the several thousand SHF members who wisely choose GP as their broker of choice.

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 Tommaso (milanese) for all the incredible work he does here.
User avatar
SteveHopwood
 
Posts: 9106
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Moving Day

Postby trader689 » Fri Apr 03, 2020 6:35 pm

great thanks Steve! :clap:

trader
trader689
 
Posts: 466
Joined: Thu Nov 17, 2011 12:53 am

PreviousNext

Return to Moving Day

Who is online

Users browsing this forum: No registered users and 0 guests

cron