ScrewTurn

Active Trader Strategies API Community ChartStyles Community Commissions Community Components Community Indicators Knowledge Base Misc Optimizers PosSizers Providers Standard Indicators TASC Traders Tips TASCIndicators Tutorial Videos Visualizers
RSS

Navigation







Quick Search
»
Advanced Search »

PoweredBy

Syntax


public void WinLossBackground( int mode )

Parameter Description

mode mode selects the color scheme: 0 standard (light red, light green), 1 strong (red, light red, yellow, light green green)

Description

Originally created for WL4 by Dr.Koch and coded for WL5 by thodder.

Paint background according to profit. Handles overlapping positions. 
With overlapping positions the worst trade determines the background color

trades better than 0.5 percent are marked green trades worse than -0.5 percent are marked red the trades between -0.5% and +0.5 % are marked yellow in mode 1 trades better/worse than +5%/-5% are marked with a stronger green/red color

Usage

Add a call to WinLossBackground(mode) after the main (trading) loop i.e. at the end of your Strategy.

Example

Here is an example illustrating how to use the method in your Strategy code:


using System;
using System.Text;
using WealthLab;
using Community.Components;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { for(int bar = 20; bar < Bars.Count; bar++) { if (IsLastPositionActive) { //code your exit rules here } else { //code your entry rules here } }

Community.Components.Utility u = new Community.Components.Utility(this);

// Call the method u.WinLossBackground(1); } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes.

Used under license from FMR Corp. Copyright 2008 FMR Corp. All rights reserved.


ScrewTurn Wiki version 3.0.2.509. Some of the icons created by FamFamFam.