Bullscript |
Post Reply |
Author | |
cwb
Newbie Joined: 27 May 2010 Location: Townsville Posts: 9 |
Post Options
Quote Reply
Topic: Bullscript 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 |
|
cmacdon
BullCharts Guru Joined: 09 Sep 2012 Location: Brisbane Posts: 236 |
Post Options Quote Reply 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
|
|
Post Reply |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |