Is it possible to display the exact course of the last 100 mondays at 09.00 o´clock in the morning for example in the form of a graph? If so, in best case can we use the tick data? And how far does the tick data go back to PRT for a backtest?
kind regards
You do not need tick data.
If dayofweek = 1 and Time = 090000 then
close090000 = close
endif
return close090000 as "Kurs Montag 9:00"
In a 1h or 4h chart, this may go back up to 10 years, I think.
close090000 does not yield the opening price at 9:00, but the last closing price the tick before. Both will be almost identical in most cases.
Hallo und Vielen Dank.
Derselbe Code gilt dann wohl auch für den Schlusskurs Montag 10.00 Uhr – korrekt?
Wenn ja, kann ich mir die Differenz der Schlusskurse in einem über/unter Null Graph anzeigen lassen?
Sorry, I don’t know much about histograms. You may want to consider the programming manual.
And : this is an English forum, please. We speak German in the German forum.
to graph the difference as a line only :
If dayofweek = 1 then
If Time = 090000 then
close090000 = close
endif
If Time = 100000 then
close100000 = close
endif
endif
If TIME >= 100000 then
diff = close100000 - close090000
endif
return diff as "Differenz Kurs 10:00 - Kurs 9:00"
You can change this in the chart manually to a histogram, I think, or look it up in the manual how to code this.
So let’s give it a shot.
Due to the historical prices of Monday 9 a. m. I want to take a position which corresponds to the average development of the last 1000 assembly, for example.
If it is possible to reproduce this in PRT, you can reproduce it for all other time periods, e. g. Tuesday 11:00.
And more precisely:
When I open a long position with this code on Monday 9:00 a. m., I can “see” that this position is growing due to the historical data.
I would like to use this indicator to determine whether the opening of the position is “worthwhile” under these conditions.
Do you understand everything? Did I put it right?
kind
Translated with http://www.DeepL.com/Translator
//-------------------------------------------------------------------------
// maincode : Monday Morning om Dax
// created by bluetime
//-------------------------------------------------------------------------
once Position = 1
c1 = Opendayofweek = 1
c2 = time = 090000
c3 = close> open
IF c1 and c2 and c3 Then
buy Position contract at market
Endif
Set Stop pLoss 40
Set target pprofit 40
addendum
So I want to know nothing more than whether opening a position on the basis of historical data is worthwhile at this point in time. With a fixed SL and TP or by closing the position at a certain time.
Because i open a postion with the same code on tuesday 09.00 the result ist this