|
allan nathan
2012-10-02 13:17:46
|
|
Hi,
I am using the MM staggered entry and exit rules and can not figure out how to code an exit
'entryprice' + 2 ATR
is there a field called entryprice??
Thanks,
Allan
|
|
|
|
QuantShare
2012-10-02 17:20:53
0
|
|
You can access entry price only using the money management script.
You can set an exit at "entryprice" + 2ATR, by adding a stop loss (Point) with "2 * atr(1)" as level.
|
|
|
|
allan nathan
2012-10-02 19:39:27
0
|
|
Well that was easy enough!!!
Am i correct that one can only write a money management script if they know Csharp or other languages???
You cant write a script with QS language?
Thanks,
Allan
|
|
|
|
QuantShare
2012-10-02 19:54:21
0
|
|
A money management script can be implemented only using C# or JScript.Net.
|
|
|
|
allan nathan
2012-10-02 22:33:24
0
|
|
if I want to optimise a variable in a money management,do i need to implement C# or jscript??
Can one use QS language for Optimize.Optimizedouble in the Onstartsimulation ?
Allan
|
|
|
|
QuantShare
2012-10-03 10:54:35
0
|
|
"Optimize.Optimizedouble" is a C# function.
Example to vary "a" from 1 to 10:
Optimize.OptimizeDouble("a", 1, 10, 1);
The Staggered Entry and Exit Strategy item allows you to enter a QS language rule in the MM variables because, internaly, the MM script takes this entered value (in Text format) and use it with the function: Data.ParseFormula("");
The above function allows you to parse a QS language formula within a C# script.
(by QuantShare,
uploaded several months ago)
No notes
|
|
|
|
|
allan nathan
2012-10-03 12:45:33
0
|
|
For MM scripts in C#,does the Optimisation,i.e 'Optimize.OptimizeDouble("a",1,10,1)
take place in theStrategy formula editor or at the Advanced Money Management OnStartSimulation event??
I am using the Staggered entry script with no problems,and I see one can optimise the variables at the strategy level in the formula editor.However,when i go to MM and click on Update to view the formula,I do not see Optimize.OptimizeDouble in the code at OnStartSimulation event..
Where does one enter that code/
Thanks for the help,
Allan
|
|
|
|
QuantShare
2012-10-03 20:08:08
0
|
|
It should be placed in the MM OnStartSimulation event.
What exactly do you want to optimize?
If you want to optimize the formula entered in the MM input of the Staggered entry script then you cannot do that. This MM script doesn't allow you to do that.
|
|
|
|
allan nathan
2012-10-04 00:04:50
0
|
|
Hi,
I am looking to optimize various money management variables such as "Risk"," and # of positions" (as in the following examples).
I dont have the ability to code in C# and find myself very reliant on other to code MM scripts that may work for me. I really like QS,but the documentation is not at the same level as the program and it can make things very challenging for the non programmers.
Buy = <your buy formula here>
Sell = 0; // selling only by stop
TrailStopAmount = 2 * ATR( 20 );
Capital = 100000;
Risk = 0.01*Capital;
PositionSize = (Risk/TrailStopAmount)*BuyPrice;
ApplyStop( 2, 2, TrailStopAmount, 1 );
--------------------------------------------------------------------
posqty = Optimize("PosQty", 4, 1, 20, 1 );
SetOption("MaxOpenPositions", posqty);
// desired position size is 100% portfolio equity
// divided by PosQty positions
PositionSize = -100/posqty;
|
|
|
|
allan nathan
2012-10-04 02:34:12
0
|
|
I just want to be clear ..QuantShare is an awesome product.It has so many excellent features that it can be a bit overwhelming for the non programmer.I should have said the documentation does not do the program justice.
Thank you,
allan
|
|
|
|
|