I can manipulate my script edito by now.
But I'm nowhere, let's be honnest. There are so many commands that you would save me time indicating me whitch set of command I could Start with for my first «own scrpit ».
I read a lot in the forum but didn't find what I want or maybe came accross without noticing that was the command Iwas looking for.
I will give and example I think this is the best way
I intend working this way
protectedoverridevoid Initialize()
{
CalculateOnBarClose = False;
}
I'm not interested in bars closed though I know it is CPU intensive
I have the EURJPY a 120,55
I will write this example for a long entry but the logic would be the same if I would go short
As I enable my strategy, I want this 120,55 value stored in a « double » variable
(This is my first problem, I have been unable to find a way for doing so)
Let's say The EURJPY moves up 1 pip up to 120,56
At time I want to start a stop watch to 0 second
First case
The EURJPY moves up 4 more pips to 120,60 within 3 seconds, I would enter long
Second Case
3 seconds have elapsed and the EURJPY moved up to 120,59
It didn't fill my condtions to enter long and the stop watch resets to Zero
Third Case
The EURJPY went up to 120,58 and then back down to 120,57. Well, it didn't fill my conditions either
But....
It might be a new begining of a short entry process
I went down one pip, didn't he ?
I now want the 120,58 stored in my double Variable and restart a stop wath to Zero
And If the EURJPY moved down within 3 second I enter Short.
TO REPHASE THIS IN SHORT
- How to I do To get the Actual Value of the EURJPY in a variable as I start my strategy.
- How do I start a stop watch
Thanks in advance
Benwinckelmans

Comment