Exploring a simple Script
In today’s blog I want to introduce one of the most important concepts in the script. The code goes like this.**//approximate 4 hour BB breakoutif (High[0]>= BLG_U[0](Close, 80, 2)) thenbuysellzone=-1lastBreakPrice=high[1]endifif (Low[0]<= BLG_L[0](Close, 80, 2)) thenbuysellzone=1lastBreakPrice=low[1]endifI feel it’s one of the most significant parts because it calls on those global variables we assigned earlier and allows you to hold a specific condition until another definable condition is meat regardless of what happed between. With most scripts, the whole statement is either true or false, but with these the condition can be false but as long as the second condition isn’t meet then you can keep a value assigned to the global variable. Here’s an example of what I am talking about. **Let’s say you wanted to buy if RSI, Slow K became oversold in the last 24 hours and the PSAR supports a long. In regular statements unless all three conditions were meet at exactly the same time the statement not evaluate as true. But using these tyope of stamen the value can be held true even if the three conditions happened independently of eachother , but were true sometime in the last 24 hours.Using this example, the following script produced absolutely no trades.**if RSI[0](Close, 14) <>
However, by creating a buy/sell zones you can handle this instance and find trades based on the criteria involved. **global rsif LLV(RSI[0](Close, 14), 24) < thenrs =" 1elsers" rs =" 1" id="BLOGGER_PHOTO_ID_5364781958690959346" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 266px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWGdSKyHtWMiXLxrfd8oq0XPN0LWRlxJJgTJjmOTFa0w17J1sSvV4rVPskrcn-h9WmhUHZ_9W1HqxyhctoPfX4DHQYFucvxo42Id1u_s_gMXjsrr1qTE-h5_QeR1V7eR-oix1fkyoEaHw/s400/c2222.jpg" border="0">
إرسال تعليق