Syntax for capturing previous bid/ask in Easylanguage - EasyLanguage Programming | futures io social day trading
futures io futures trading


Syntax for capturing previous bid/ask in Easylanguage
Updated: Views / Replies:539 / 6
Created: by mashficool 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
 

Syntax for capturing previous bid/ask in Easylanguage

  #1 (permalink)
Trading Apprentice
columbus, GA
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: EMINI ES
 
Posts: 7 since Jun 2016
Thanks: 4 given, 3 received

Syntax for capturing previous bid/ask in Easylanguage

I am brand new to EasyLanguage, so struggling to find a simple syntax.

Example below identifies he problem in detail:

Problem 1) I currently am looking at a 1 min chart window and see the price on @ESM16 go
from $2115.00 to $2114.75.

I am trying to code a logic that will identify the previous price of $2115.00 and current price of $2114.75 and put them in two different variables. Then compare the variables to see which one has a greater numeric value.

I know this is basic easy language stuff, but I am new to Easylanguage so please understand.

Regards,
Mash

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary


Mash,

EasyLanguage code is executed from top to bottom, therefore you can save an old value before overwriting it like this:

 
Code
myOldValue = newValue ;
newValue = Close ;
Now the variable myOldValue will hold the value that was last stored (during the last code cycle) in newValue and newValue will hold the value that Close currently has.

You might also want to look into "intrabarpersist", what it does and if you might need it for your solution.
By the way you can show your appreciation for a post here on Futures.io using the "Thanks" button under it.

Regards,

ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #4 (permalink)
Trading Apprentice
columbus, GA
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: EMINI ES
 
Posts: 7 since Jun 2016
Thanks: 4 given, 3 received


ABCTG View Post
Mash,

EasyLanguage code is executed from top to bottom, therefore you can save an old value before overwriting it like this:

 
Code
myOldValue = newValue ;
newValue = Close ;
Now the variable myOldValue will hold the value that was last stored (during the last code cycle) in newValue and newValue will hold the value that Close currently has.

You might also want to look into "intrabarpersist", what it does and if you might need it for your solution.
By the way you can show your appreciation for a post here on Futures.io using the "Thanks" button under it.

Regards,

ABCTG

ABCTG, your answer really helps. Thanks a bunch, but this puts another question in my mind.

The reserved word "Close", does it take the closing price of the previous bar? I think so right?

if so, then I need a strategy that picks up the previous price, whether it happened in the last minute or whether it happened in the last Nano second and not necessarily from the closing price from the previous bar.
Does intrabarpersist give me the ability to pick up that price that came immediately before the current price?

Also I need to figure out a way to capture the current price, compare this with previous price and then compute whether the price went Down 0.25 or went Up 0.25 (strictly monitoring the minimum price move "direction" for S&P Emini in 0.25 increments)

Maybe I can format my charts to "Kase Chart" and make the target value range as 0.25 ? Maybe this is not the right solution...I am confused here.

Thanks so much for helping!

Reply With Quote
The following user says Thank You to mashficool for this post:
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

mashficool,

sometimes it helps to print the values of a variable or reserved word to see what value it holds.
Close will return the last price a trade took place at.

That's why the code snippet I posted could be used to compare the last two ticks (or better the last two values close had while your code was executed) provided the two variables are intrabarpersist and your code is executed intrabar.

Regards,

ABCTG

Reply With Quote
 
  #6 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


mashficool View Post
The reserved word "Close", does it take the closing price of the previous bar? I think so right?

Yes, `Close` returns the closing price of a bar: `Close` returns the current bar's closing price, `Close[1]` of the previous bar, and `Close[2]` of the bar before that, and so on.

There's one exception to this, and that's when the bar that the script currently calculates on is still being updated (that is, it's a real-time bar and ticks are still incoming). In that case, `Close` refers to the current, most recent tick.


mashficool View Post
Also I need to figure out a way to capture the current price, compare this with previous price and then compute whether the price went Down 0.25 or went Up 0.25 (strictly monitoring the minimum price move "direction" for S&P Emini in 0.25 increments)

If you mean with 'price' the closing price, you can do that like:

 
Code
Variables:
  priceDifference(0);
  
priceDifference = Close - Close[1];

if (priceDifference = 0.25) then
  Print("Up 0.25 points")
else if (priceDifference = -0.25) then
  Print("Down one 0.25 price increment");

mashficool View Post
Maybe I can format my charts to "Kase Chart" and make the target value range as 0.25 ? Maybe this is not the right solution...I am confused here.

You may of course adjust your charts if you want to, but it's not needed per se since it can also be done with code (and so you can keep the chart like you want it).

Reply With Quote
The following user says Thank You to Jura for this post:
 
  #7 (permalink)
Trading Apprentice
columbus, GA
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: EMINI ES
 
Posts: 7 since Jun 2016
Thanks: 4 given, 3 received


Jura View Post
Yes, `Close` returns the closing price of a bar: `Close` returns the current bar's closing price, `Close[1]` of the previous bar, and `Close[2]` of the bar before that, and so on.

There's one exception to this, and that's when the bar that the script currently calculates on is still being updated (that is, it's a real-time bar and ticks are still incoming). In that case, `Close` refers to the current, most recent tick.


If you mean with 'price' the closing price, you can do that like:

 
Code
Variables:
  priceDifference(0);
  
priceDifference = Close - Close[1];

if (priceDifference = 0.25) then
  Print("Up 0.25 points")
else if (priceDifference = -0.25) then
  Print("Down one 0.25 price increment");

You may of course adjust your charts if you want to, but it's not needed per se since it can also be done with code (and so you can keep the chart like you want it).

Do I have to use Intrabarpersist = true in this code above that you gave me? or will it work without it? I am still learning the Intrabarpersist thingy in easylanguage.

When you write a script to take a position when certain conditions occur,
("if this = this and this.. then do that") how do you make sure the script does not keep taking new positions? is there a reserve word in easylanguage for that ? in ninjatrader topic here in this forum, I found the word to be EntriesPerDirection but such words does not exist in easylanguage..

Reply With Quote

Reply



futures io > > > > > Syntax for capturing previous bid/ask in Easylanguage

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
Help: Inhibit Ninja Default Mouse action while capturing clicks SharkPub NinjaTrader Programming 2 July 23rd, 2015 06:45 AM
EasyLanguage entry in active bar on previous bar's low tolu7325 EasyLanguage Programming 3 July 29th, 2013 10:08 AM
Syntax - what do question marks do? xigreek NinjaTrader Programming 1 March 4th, 2013 05:43 PM
Previous Hour High and Low times in easylanguage onava TradeStation 3 April 26th, 2012 02:02 PM
NT Falling() Syntax aligator NinjaTrader 6 March 10th, 2011 09:11 PM


All times are GMT -4. The time now is 03:52 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.11 seconds with 19 queries on phoenix via your IP 107.20.115.174