Log in to see Cloud of Tags

Wealth-Lab Wiki

Limit On Open Orders (LOO)

RSS

Syntax

public static Position EnterLOO(this WealthScript ws, int tradeBar, PositionType pt, double limitPrice, string signalName = "") public static bool ExitLOO(this WealthScript ws, int tradeBar, Position p, double limitPrice, string signalName = "")

Parameter Description

tradeBarPass bar + 1 to this method
ptPositionType.Long or PositionType.Short
limitPriceLimit price
signalName(optional) Entry/exit signal name

Description

Created by Robert Sucher, these methods emulate Limit On Open (LOO) orders.

Example

Example using C# extension methods:

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { for(int bar = GetTradingLoopStartBar(20); bar < Bars.Count; bar++) { if( bar < Bars.Count-1 ) // for backtesting only { if (IsLastPositionActive) { this.ExitLOO(bar+1, LastPosition, Highbar); } else { this.EnterLOO(bar+1, PositionType.Long, SMA.Value(bar, Close, 20) * 0.98); } } } } } }

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. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.