Holding A Value - futures io
futures io futures trading



Holding A Value


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Joe50 with 5 posts (0 thanks)
    2. looks_two ABCTG with 3 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 kjhosken with 1 posts (0 thanks)
    1. trending_up 1,089 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Holding A Value

(login for full post details)
  #1 (permalink)
HONOLULU
 
 
Posts: 23 since Feb 2019
Thanks: 6 given, 3 received

Hi,

I am using Tradestation 2000i which is similar to the newer versions.

Anyway, this is what I am trying to do:

I created a script where

If X = 3 then Begin

HP = High
LP = Low

end;

IF X > 3 Then Begin

Value1 = IFF (High > HP, 1,0);
Value2 = IFF (Low < LP,-1,0);

End;

How do you code the following:

If Value1 = 1 then Begin

HP2 = High

If Value2 = -1 then Begin

LP2 = Low

end;
end;

What I am trying to do is capture the high and low price of the exact moment when value1 and value2 occur. How is this done ?

Thankyou to all who reads this.

Reply With Quote

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
 
Posts: 88 since Sep 2016
Thanks: 7 given, 32 received


There's probably better ways to do it but maybe try something like this:
if (value1 = 1 and value1[1] = 0) then HP2= high else hp2 = hp2[1];

Bare in mind if you are looking for the exact moment that value1 turns true it's exactly when high > hp, therefore hp2 will be just 1 tick higher than hp

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #4 (permalink)
HONOLULU
 
 
Posts: 23 since Feb 2019
Thanks: 6 given, 3 received

Oh , I see what you are doing. Smart. Let me mess with this and see what happens.

Thankyou for your reply !

Reply With Quote
 
(login for full post details)
  #5 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Joe50,

you could also do this within the following block. Instead of using IFF you could use a regular if... then begin statement and store a value in a variable when the condition you check for is true.

 
Code
IF X > 3 Then Begin

Value1 = IFF (High > HP, 1,0);
Value2 = IFF (Low < LP,-1,0);

End;
Regards,

ABCTG


Joe50 View Post
Oh , I see what you are doing. Smart. Let me mess with this and see what happens.

Thankyou for your reply !


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #6 (permalink)
HONOLULU
 
 
Posts: 23 since Feb 2019
Thanks: 6 given, 3 received

Hi ABCTG,


Thankyou always taking the time to reply to me !

OK, That is good to know. I am trying to figure out how to get the HHV/LLV between the two values HP and LP.

Do you think that would work using HHV or LLV ?


Thankyou for the clue !

Reply With Quote
 
(login for full post details)
  #7 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Joe50,

depends on what you mean with HHV/LLV.

Regards,

ABCTG


Joe50 View Post
Hi ABCTG,


Thankyou always taking the time to reply to me !

OK, That is good to know. I am trying to figure out how to get the HHV/LLV between the two values HP and LP.

Do you think that would work using HHV or LLV ?


Thankyou for the clue !


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #8 (permalink)
HONOLULU
 
 
Posts: 23 since Feb 2019
Thanks: 6 given, 3 received

Hello ABCTG,

Thankyou for your reply.

The Highest High if Value1 = 1 and Value2 = 0 or the Lowest Low if Value1 = 0 and value 2 = -1.

Reply With Quote
 
(login for full post details)
  #9 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Joe50,

you can use a new variable and when ever High > HP you would check if the High is also higher than this new variable and if it is update it to the new higher high. Depending on your intentions it could also make sense to reset this new variable to High at "If X = 3", too.

Regards,

ABCTG



Joe50 View Post
Hello ABCTG,

Thankyou for your reply.

The Highest High if Value1 = 1 and Value2 = 0 or the Lowest Low if Value1 = 0 and value 2 = -1.


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #10 (permalink)
HONOLULU
 
 
Posts: 23 since Feb 2019
Thanks: 6 given, 3 received


Hello ABCTG,

OK, I will try this. I'll see what happens.

Thank You Again !

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Holding A Value


Last Updated on July 10, 2019


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 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