Reply

how to store a trigger point’s low for 7 candle periods?

12 replies

TJ#

Customer, bbp_participant, community, 144 replies.

Visit profile

8 years ago #114668

hi Tomas,

 

How do I store a trigger point’s low for 7 candle periods?

 

I came across something similar from the thread below and curious how it is being coded.

 

https://strategyquant.com/forum/topic/3867-tracking-swing-points-on-renko-charts/?hl=store#entry13661

 

 

Appreciate if you able to give a simple sample of how it works? Thank you.

File: 123.png123.png

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

8 years ago #135155

Under “Custom Indicators”, choose “Highest (HIGHEST)” and “Lowest (LOWEST)”.
-Stearno

Sent from my HUAWEI MT7-TL10 using Tapatalk

0

TJ#

Customer, bbp_participant, community, 144 replies.

Visit profile

8 years ago #135159

Thanks Stearno,

 

How to store that value for 7 periods? 

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

8 years ago #135177

Well, the input for these is the way. So you do Highest(7). Then it will show you the highest in the last 7 bars. Does that do what you want?
-Stearno

Sent from my HUAWEI MT7-TL10 using Tapatalk

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

8 years ago #135187

TJ, to store values for later calculations, just create an appropriate variable for it and assign it some value

0

TJ#

Customer, bbp_participant, community, 144 replies.

Visit profile

8 years ago #135197

hi Tomas,

 

Can share a sample of that? I tired but it did not work. Thanks. 

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

8 years ago #135208

I had a suspicion that is what you meant. Here is an example of assigning to a variable.

 

The key is going to be what you put in the IF condition.  Once the IF condition is met, only then it will trigger the assigning of the variable.

 

-Stearno

0

TJ#

Customer, bbp_participant, community, 144 replies.

Visit profile

8 years ago #135211

” The problem is if you want to “store” those swing prices. How many swing prices do you need to reference? You can create multiple variables to store that prices like Swing1, Swing2, Swing3 and when a new swing is detected you just set Swing1 variable to the last swing price (High[2]/Low[2]), Swing2 to Swing1 value. Swing3 = Swing2 etc. You can then compare individual swing prices. But it can get very complicated if you want to reference lets say last 20 swings or more….. ”   ==> screen shot posted.on 15 Feb

 

This is what I am trying to do..l

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

8 years ago #135212

Okay. Now I understand. I what you want to do. How about to create your rules of a swing point in the IF portion of the Condition. Then in the THEN, part, you put the following “Assign to Variables” in the opposite order:
Assign Variable 20 from variable 19
Assign Variable 19 from variable 18
Assign Variable 18 from variable 17
Etc
Etc
Assign Variable 2 from variable 1
Assign Variable 1 from new swing pivot (the high / low as you Calc it.

So you would have 20 variables that you can then reference the last 20 swing points.

This is a simple way to do it. I am sure there might be a complex way (complex to me) to do with arrays in the custom function. But I have jot used the custom function.

I wrote an indicator that inside it it calculated the last x swing points. I will look to see if I can find it tomorrow. If I do, I will give to you as I think that will do what you want more easily.

-Stearno

Sent from my HUAWEI MT7-TL10 using Tapatalk

0

TJ#

Customer, bbp_participant, community, 144 replies.

Visit profile

8 years ago #135234

hi Steamo,

 

Shall wait for your sample sqw. Before posting to the forum, I have tired to write the conditions myself but it did not turn out well. Thanks. 

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

8 years ago #135271

Here it is.

0

TJ#

Customer, bbp_participant, community, 144 replies.

Visit profile

8 years ago #135292

hi Stearno

 

Thank you for the mq4 file.

 

How do I use this in the sqw? Store the triggered price’s low (or high) for 7 candles?   

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

8 years ago #135542

You will load it as a custom indicator. Then reference the 7 buffers. At any one time those buffers will be filled with the last 7 pivots.

Sent from my HUAWEI MT7-TL10 using Tapatalk

0

Viewing 12 replies - 1 through 12 (of 12 total)