Assign value to the close price at a specific time - AmiBroker | futures io social day trading
futures io futures trading


Assign value to the close price at a specific time
Updated: Views / Replies:715 / 2
Created: by sunsun Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Assign value to the close price at a specific time

  #1 (permalink)
Trading Apprentice
hong kong
 
Futures Experience: Beginner
Platform: tradestation
Favorite Futures: futures
 
Posts: 6 since May 2013
Thanks: 1 given, 1 received

Assign value to the close price at a specific time

Hi, I would like to assign the close of a specific time to a variable but I still couldn't figure out. I really appreciate if someone can give me a hand. The logic is as follows,

if time = 093000 then
refprice = close;

Reply With Quote
 
  #2 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received


sunsun View Post
Hi, I would like to assign the close of a specific time to a variable but I still couldn't figure out. I really appreciate if someone can give me a hand. The logic is as follows,

if time = 093000 then
refprice = close;

Not sure what you wanna do with it but here you can see the difference between using ValueWhen and Iif.
See the help description of those two functions

 
Code
timecondition = TimeNum() == 093000;
iifclose = IIf( timecondition, Close, Null );
valclose = ValueWhen( timecondition, Close );

// Plot
SetChartOptions( 0, chartShowDates | chartShowArrows | chartWrapTitle );
Plot( iifclose, "iifclose", colorRed, styleHistogram, Null, Null, 0, 0, width = -60 );
Plot( valclose, "valclose", colorOrange, styleLine, Null, Null, 0, 0, width = -20 );
If you wanna calculate some average or other calculations based on those specific time close prices only then you have to use different function(s). SparseCompress and SparseExpand. 5.91 has built-in functions of those ones, for older AB versions you have to use AFL functions. See AmiBroker 5.91.0 BETA Read Me

Reply With Quote
 
  #3 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received



prouser View Post
If you wanna calculate some average or other calculations based on those specific time close prices only then you have to use different function(s). SparseCompress and SparseExpand. 5.91 has built-in functions of those ones, for older AB versions you have to use AFL functions. See AmiBroker 5.91.0 BETA Read Me


 
Code
// for versions lower than 5.91 use AFL functions of sparsecompress/expand
//http://www.amibroker.com/devlog/wp-content/uploads/2015/02/readme5910.html

Version( 5.91 );

SetBarsRequired( 10000, 10000 );

timecondition = TimeNum() == 093000;
only_when = timecondition; // only when condition
x = SparseCompress( only_when, Ref( Close, -1 ) ); // compact sparse data, Close of 09:29:59.999
y = MA( x, 10 ); // regular calculation
y = SparseExpand( only_when, y ); // expand sparse data

// Plot
SetChartOptions( 0, chartShowDates | chartShowArrows | chartWrapTitle );
Plot( C, "Price", colorDefault, styleBar, Null, Null, 0, 0, width = -20 );
Plot( ValueWhen( timecondition, y ), "Sparse MA from time condition", colorRed );

// exploration
Filter = timecondition;
AddColumn( Ref( Close, -1 ), "Close of 09:29:59.999", 1.5 );


Last edited by prouser; March 3rd, 2015 at 03:50 PM.
Reply With Quote
The following 2 users say Thank You to prouser for this post:

Reply



futures io > > > > Assign value to the close price at a specific time

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to exit EXACTLY as specific price (while BACKTESTING) selnomeria EasyLanguage Programming 2 December 16th, 2014 07:29 AM
H/L FOR A SPECIFIC PERIOD OF TIME FKtrader NinjaTrader 2 October 20th, 2013 12:30 PM
automated buy order on specific size bar close ncsutrader Elite Automated NinjaTrader Trading 3 May 27th, 2013 11:24 AM
Price movement during a specific time period thewardiknowof NinjaTrader 10 November 22nd, 2012 08:28 PM
Price marker at specific time meyer99 NinjaTrader 5 July 22nd, 2011 08:04 PM


All times are GMT -4. The time now is 07:41 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-17 in 0.07 seconds with 19 queries on phoenix via your IP 54.163.209.109