Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Store Value and Compare

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Store Value and Compare

    In strategy builder, Attempting with a 2 different int default 0 to then calculate and define and store a value for each of the int variables, THEN COMPARE THE TWO TO EACH OTHER

    CRUDE EXAMPLE to store indicator values

    CONDITIONS AREA OF CODE

    SampleValue1 = MACD 6 bars ago onbarclose - MACD displaced 0 bars ago onbarclose

    SampleValue2 = MACD 20 bars ago onbarclose - MACD displaced 10 bars ago onbarclose

    SampleValue1 > SampleValue2

    ACTION

    PAINTBACKBRUSH = BLUE

    Can I actual store those Values in that manner
    Thanks

    #2
    Hello DTSSTS,

    Thanks for your post.

    The MACD indicators values are of a double type. You can create integer type variables and when you assign the MACD results to it, the variable will only hold the whole number value of the MACD (no values after the decimal point of the MACD) I suspect you really want these to be double values instead of Integer type.

    You would not be able to use displacement in the strategy builder.

    You can certainly subtract the MACD value 6 bars ago from the current bar of the MACD and can subtract the MACD 20 bars ago from the MACD of 10 bars ago.

    In order to populate your variables, I would suggest using a set that has no conditions and the only actions would be to assign the subtracted values to the variables. By using a set without conditions, these variables would be updated on each bar (or tick) depending on the strategy Calculate setting.

    The back brush can be found in the action section under Drawing>Set background color.



    Comment


      #3
      Wil a double hold the values of dollar figures ie price if the indicator i am plotting is plotting dollars and of course they have decimals

      thanks

      Comment


        #4
        Hello DTSSTS,

        Thanks for your reply.

        Yes, a double type variable can hold floating-point values within the range of -1.79769313486232E+308 to 1.79769313486232E+308

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        71 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        143 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        76 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        47 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        51 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X