BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Bullscript
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Bullscript

 Post Reply Post Reply
Author
Message Reverse Sort Order / View First Unread Post
cmacdon View Drop Down
BullCharts Guru
BullCharts Guru


Joined: 09 Sep 2012
Location: Brisbane
Posts: 236
Post Options Post Options   Quote cmacdon Quote  Post ReplyReply Direct Link To This Post Topic: Bullscript
    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
Back to Top
cwb View Drop Down
Newbie
Newbie
Avatar

Joined: 27 May 2010
Location: Townsville
Posts: 9
Post Options Post Options   Quote cwb Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz