Money Management

Questions about MultiCharts and user contributed studies.
morgz
Posts: 1
Joined: 07 Jun 2020

Money Management

Postby morgz » 11 Jun 2020

Hello All,
I am trying to use the not so easy , easy language to talk computer from the land down under ! The main aim for this post is to try and understand the relationships needed for money management and the code in the signals to all talk (the same language) , together. I am using multicharts 64. Using end of day metastock data.

I am having some trouble getting this code to work in the portfolio trader , as the money management signal ? All im trying to do is the standard 1% rule , and have my trading float of 40k and use a 1% trade size calculation. Use of these settings in the portfolio trader do not work for me. I have been clicking away for days and looking at the manuals , but I have to admit that for me even the manual is a bit hard to interpret. It would be great if there was some super basic prebuilt system in MC that we can actually see what goes where , link the dots so to speak.

Code: Select all

//money management variables: entryprice(0) , stoplosslevel(1), stopvalue(2), accountvalue(3), risk(4), Qtyshares(5), positionsize(6); // entry price entryprice = close; //stop loss level stoplosslevel = close - low[1]; //Stop Value stopvalue = entryprice-stoplosslevel; //Available funds for trading accountvalue = 40000; //Risk 1% of 40k risk = 40000*1/100; //quatity of shares Qtyshares = risk / stopvalue ; //Position size value positionsize = Qtyshares * entryprice;
[/code]
system test.png
(23.84 KiB) Not downloaded yet

The code i am trying to use is below. I dont know how to fix this yet either. Again many days trying different types, I tried with variables too but not able to get that to work properly too. . The signals are not right on a chart, but a couple are. It seems that the first condition is always right. And the second condition is not being triggered. And the third condition is always right. However , the third condition is starting at the first and not at the second condition as it should. See screen shot.
The basic principal was
condition 1 to buy a breakout
condition 2 was a small dip in price action
Then after the dip, condition 3 would exit

Nothing spectacular , but if I can get my head around how all this looks, and works , im sure I will be on my way to building something more involved. Still need stop losses and work out how to get trade management to get position size from my actual account float value as it changes, but one step at a time. This is just a basic example to get started.

Code: Select all

//buy signal condition1 = low > low[1] And low [2] > low[1] and close > High[1]; if condition1 then buy this bar at close ; //Intermitent condition trigger condition2 = low > low[1] And low [2] > low[1]; //sell condition condition3 = close < low[1]; //sell signal if condition1 then begin condition2 ; end; if condition2 then begin condition3; end; If condition3 then sell this bar at close ;
Apology in advance for using the terms condition1 etc but not sure how to change them yet.
Again my main aim is to try and get a basic thing to work, so i can understand how it ALL works. I really appreciate any help you can give.

Cheers
Morgz

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Money Management

Postby JoshM » 16 Jun 2020

Hi there! What did you plan to do with this piece of code?

Code: Select all

//sell signal if condition1 then begin condition2 ; end; if condition2 then begin condition3; end;
I suspect you meant that, if `condition1` is true, `condition2` should become true as well. And when `condition2` is true, `condition3` needs to be true as well.

If that interpretation is correct, then the correct code becomes:

Code: Select all

//sell signal if condition1 then begin condition2 = true; end; if condition2 then begin condition3 = true; end;
I hope this solves the problems you're having with the strategy. Good luck!


Return to “MultiCharts”