Print Page | Close Window

Bullscript

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=1010
Printed Date: 04 May 2024 at 10:41am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Bullscript
Posted By: cwb
Subject: Bullscript
Date Posted: 26 Jan 2017 at 3:57pm
I am wanting to write a formula to determine force exit date -- lets say after 90 days that takes into account weekends (and p/hols). Appreciate any inputs

I have used dateadd function as below ... for simple 9 day force exit ( in for 9 days then exit the following day)

TriggerDate:=(now);

BidDate:= dateadd(1,TriggerDate);

BidDay:=DAYOFWEEK(BidDate);

if (BidDay = 1,dateadd(13,BidDate),dateadd(13,BidDate))


Can calculate this easier enough in excel but was hoping to write it into script within scans



Replies:
Posted By: cmacdon
Date Posted: 12 Feb 2017 at 11:19am
CWB

I notice there were no responses to your request.  You may have since worked out what you wish to achieve by now.

If not , if you think in terms of trading days in the future for a trigger to go off instead of Calendar days.

Have a look at the code for the earlier post below and I think you can get to where you want.

Set a trigger or marker to go off at the last or next bar after the future period calculated by that indicator, and it should work.  You can remove some of the other script not needed for your application.

cmacdon
http://bullcharts.com.au/forum/forum_posts.asp?TID=1007&title=profit-taker


-------------
BC User since June 2007



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk