Reply

Using Loops and Filters to Find Historical Candles with Conditions

1 replies

Maicol Eduardo Martinez Gonzalez

Subscriber, bbp_participant, sq-ultimate, 3 replies.

Visit profile

3 months ago #286922

Hi AlgoWizard community,

I’m currently working on a project where I need to find candles that meet certain conditions in the past. Specifically, I need to identify the most recent candle with a lower high to the left and a lower high to the right, or find the closest bullish candles relative to the current price when the price is below these candles.
<h3>Questions:</h3>

  1. Are there functions like do or while loops in AlgoWizard that I can use to create these conditions?
  2. Is there a way to create filters or write custom scripts in MQL or Java to incorporate these conditions into AlgoWizard as blocks or functions?

Any guidance or examples on how to implement this would be greatly appreciated!

Thanks in advance for your help.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

3 months ago #286948

Unfortunately looping is not possible to do using SQX. I believe you do not need to use it actually. You can simply setup a condition (block) such as

High[3] < High[2] AND

High[2] > High[1]

and trigger an action upon that. The action does not need to be a “trade entry”. You can also store the High[2] value into a (double) variable and use in other conditions for example

0

Viewing 1 replies (of 1 total)