Hi guys
I’ve reach a problem when I want to do something with 2 timeframe (very simple…).
I saw in some others strategy that it’s possible to share and use a variable of a specific timeframe in an other one.
But in my case an error message say that I cannot and that I can read variables of others timeframe.
This is my little example :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// PING PONG AI - V2 TER
Defparam cumulateorders = false
ctime = time > 083000 and time < 180000
if not ctime then
limitH = 0
//limitB = 0
endif
timeframe (1hour )
IF Openhour <> openhour [ 1 ] THEN
myLastHigh = myHigh
myLastLow = myLow
myHigh = High
myLow = Low
ELSE
myHigh = Max (myHigh, High )
myLow = Min (myLow, Low )
ENDIF
if myLastHigh > Myhigh and myLastLow < myLow and ctime then
limitH = myHigh
//limitB = myLow
endif
timeframe (default )
c1a = close crosses over limitH
//c1v = close crosses under limitB
if c1a and not onmarket then
buy 0 contract at market
set stop ploss 500
set target pprofit 500
endif
Do you know the good way to share the parameters with my default timeframe ?
Thanks in advance,