Search Engine
Here you can search through the pages of this Namespace, their attachments and the files uploaded to the system.
Note: the results will only display the items you have permissions to read.
This search, performed through 4.04 MB (775 documents, 11955 words), completed in 0.0 seconds and yielded 11 results.
[...] 0.96, 0.85, 0.99, 0.01);
paramPTShort = CreateParameter("Profit Target (S)", 0.92, 0.70, 0.99, 0.01);
paramSLShort = CreateParameter("Stop Loss (S)", 1.04, 1.01, 1.15, 0.01);
}
protected [...]
[...] reward of 4) The following call accomplishes this: Position s = SplitPosition( LastPosition, 49.99 ); SplitPosition returns a new Position object that contains the remaining shares. This new Position object is also added to the end of the Positions list.
Conclusion
This is a simple example of using SplitPosition. Managing multiple positions, especially when splitting them, can be tricky. But WealthScript provides to tools necessary to implement strategies that take partial profits, or split positions into multiple parts for any other reason.
Code
using System;
using [...]
[...] RevenueEstimate, and RevenueSurprise . They are available in two forms: In a popup when mousing over an [99] eps item on a stock chart In WealthScript Strategoes via the GetDetail or FormatValue methods:
Make sure you've collected the fundamental data before running this Strategy (Data Manager > "Update Data" tab > check "99WallStreet.com earnings releases" > go to "DataSets" tab > click "Update DataSet").
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators; namespace WealthLab.Strategies
{
public [...]
[...] override void Execute()
{
int period = paramPeriod.ValueInt;
double Goal = 9.99; //Calcluate modified true range (MTR) DataSeries MTR [...]
[...] names)
//Pythagorean theorem to establish cycle amplitude
double Ampl2 = Math.Sqrt(BP2 * BP2 + Q2 * Q2);
//Trend amplitude taken over the cycle period
int [...]
[...] ah n .R;
ah n .Im3 = ah n .Im2;
ah n .Im2 = ah n .Im;
}
}
result = Median.Series(result, 10);
PlotSeries(dbPane, [...]
[...] adjacent two red bins, -0.5 and 0, have comprised losing trades which risk/reward was ranging from -0.99:1 to -0.5:1 and from -0.49:1 to 0, respectively. [...]
[...]
Exports data to ASCII comma-separated files. Sample data string: 07/31/2009,162.99,165,162.91,163.39,15090600
Example
Example using C# extension [...]
[...] MyStrategy : WealthScript
{
protected override void Execute()
{
int Period = 99;
CMO cmo = CMO.Series(Close,20);
RSI rsi = RSI.Series(Close,20);
DataSeries [...]
[...] slippage as a percentage of size (e.g. 100% sizing - 0.05% slippage - 0.05% commission, so final size = 99.9%). Related option For last position, use [...]
[...] p.Priority; // Assign the same Priority as the original Position After SplitPosition, most AsOfBar properties are invalid for the first Position [...]