Premium Only Content
Tutorial 204 | Looking for conditions to occur within specified numbers of bars of each other
A Gold Pass asked for a tutorial about how to write a program that looked for three conditions to occur, in order. The first condition should occur, then the second condition should occur within a specified number of bars of the first. Finally a third condition would occur within a certain number of bars of the second.
The occurances being looked for in this show me study are a moving average cross over, a doji and and Bullish Harami. There was no particular logic in picking these specific conditions merely just a way of demonstrating this technique.
In this example the program looks for the moving average cross over. When it found it then looks for a Doji for the next 5 bars. If the Doji is found the program then looks for a Bullish Harami with the next 24 bars. The show me plots every time one of the conditions is found, a green dot for the average cross-over, a blue dot for a Doji and a red dot for a Bullish Harami.
In the strategy version a market order is made when the three conditions have occurred.
The way the program works is by using counters that continually increment. When one of the conditions occurs, the counter for that condition is reset to zero.
Note that the initial values for the counters are set to a level where a condition is erroneously recorded.
It is useful to create a show me study prior to a strategy to ensure that the program is working as anticipated.
-
14:54
The Kevin Trudeau Show Limitless
3 days agoThe Hidden Force Running Your Life
100K20 -
2:16:35
DLDAfterDark
7 hours ago $3.67 earnedIs The "SnapPocalypse" A Real Concern? Are You Prepared For SHTF? What Are Some Considerations?
21.9K9 -
19:58
TampaAerialMedia
18 hours ago $6.07 earnedKEY LARGO - Florida Keys Part 1 - Snorkeling, Restaurants,
36.7K17 -
1:23
Memology 101
2 days ago $6.03 earnedFar-left ghoul wants conservatives DEAD, warns Dems to get on board or THEY ARE NEXT
29.9K59 -
3:27:27
SavageJayGatsby
9 hours ago🔥🌶️ Spicy Saturday – BITE Edition! 🌶️🔥
56.8K6 -
26:09
Exploring With Nug
18 hours ago $12.13 earned13 Cold Cases in New Orleans What We Discovered Beneath the Surface!
53K23 -
27:39
MYLUNCHBREAK CHANNEL PAGE
13 hours agoDestroying Time.
135K40 -
3:27:19
Mally_Mouse
9 hours ago🌶️ 🥵Spicy BITE Saturday!! 🥵🌶️- Let's Play: Minecraft Christmas Adventure!!
134K9 -
2:14:31
Side Scrollers Podcast
14 hours agoSide Scrollers INVITE ONLY - Live From Dreamhack
160K15 -
1:18:23
Simply Bitcoin
2 days ago $14.62 earnedThe Bitcoin Crucible w/ Alex Stanczyk and Lawrence Lepard
39.3K7