NexusFi: Find Your Edge


Home Menu

 





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 2,045 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

Holding A Value

  #1 (permalink)
Joe50
HONOLULU
 
Posts: 23 since Feb 2019
Thanks Given: 6
Thanks Received: 3

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

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
 
  #3 (permalink)
 kjhosken 
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
Posts: 96 since Sep 2016
Thanks Given: 7
Thanks Received: 35


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
  #4 (permalink)
Joe50
HONOLULU
 
Posts: 23 since Feb 2019
Thanks Given: 6
Thanks Received: 3

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

Thankyou for your reply !

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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
  #6 (permalink)
Joe50
HONOLULU
 
Posts: 23 since Feb 2019
Thanks Given: 6
Thanks Received: 3

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
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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
  #8 (permalink)
Joe50
HONOLULU
 
Posts: 23 since Feb 2019
Thanks Given: 6
Thanks Received: 3

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
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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
  #10 (permalink)
Joe50
HONOLULU
 
Posts: 23 since Feb 2019
Thanks Given: 6
Thanks Received: 3


Hello ABCTG,

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

Thank You Again !

Reply With Quote




Last Updated on July 10, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts