Im having a problem and I wonder if some of you smart guys have an idea to fix it?
I have made a simple program that goes long if the price returns back to a price when a green bar open on the same price as the previous red bar was closing and then follows by a new green bar.
Is there any way to save those values of StopLoss, BuyLevel and TakeProfit even if a new setup is coming before the price goes back to those levels? By now those values is changing as soon a new setup appears.
Ive been trying with count a couple of patterns to save around 3 different levels. But it is always the last one who appeared that the program is buying with.
It would be great to have the 5 latest patterns values saved until the price coming back there.
Do someone have an idea how to make it work? Should I use time limit or the date fuction maybe?
Hopefully you understand what im meaning even if its hard to explain with my bad English. 😊
Heres the code and a picture that maybe makes it a little bit easier to understand.
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
defparamcumulateorders=false
//TimeFrame
timeframe(240minutes)
GreenBar=Close>Open//Its a green bar.
RedBar=Open>Close//Its a red bar.
SameLevelGreen=Open[1]=Close[2]//Current bar is on the same level as the one before.