명시
Hi
I have an indicator that create objects in the chart and using those following some rules the new indicator will create external global variables with value = 0 ( NONE ), = 1 ( BUY ) or = 2 ( SELL ). The global variable will use PIN external integer number .
PINS are by now global variables (GV) whose name indicates the pair name and the PIN belonging and their value indicates it direction/action.
PINS GV names are formed by the pair name as prefix, the string "pin", and the PIN ID as suffix, ie, a GV named EURUSDpin1 is PIN1 for EURUSD
PIN values can be (by now) one of:
0 = None
1 = Long
2 = Short
Thus, reading PINS is just like reading these GVs, setting PINS is just like setting them, and clearing PINS is just like deleting them.
PINS GVs must be cleared once a PIN has been unloaded or changed it ID in order to avoid leaving traces behind.
Rules:
1) Only select pairs where their indices are in the extreme area : base >= x ( example 70 ) and quote <= y ( example 30 )
2) If any index above/below x value ( example 10 or 90 ), and the distance respect to another index is >= y ( example 50 )
Example for rule 2)
EUR = 90 (>70)
USD = 30 DIST 60 >>> BUY EU
EUR= 65
USD = 5 (<=10) DIST 60
>>>> BUY EU
EUR = 5 (<=10)
USD = 65 DIST 60 >>> SELL EU
EUR = 15
USD = 80 (>=70) DIST 65
>>>> SELL EU
Note: the rule used should be in all time frames selected in the first indicator