The enty trigger is saved in an intrabarpersist variabel. The signal is catching the right entryvalue (close) in the variabel at the time of the buy or sell.
The trigger is only valid for a couple of ticks and not the whole bar. And the trigger (the variabel) is updated again to not valid as it should. To get the plot on the chart, I use the barstatus(1) = 2 and add some additional triggers to the entry variabel to prevent multiple plots on different prices.
Was wondering why the textnew and plot reserved words only work when entrytrigger is still valid on barclose even if you use barmagnifier. I suspect it is because MC is using the barclose time. Like in the SPR reports where a entry is done intrabar with IOG, but you always get the barclose time instead of the intrabar real entrytime.
With the use of text_s and text_dt versions, which are used to get seconds and milliseconds precision, you will catch an intrabartime and that is why it is not plotting on the chart (in backtesting) unless you use the barstatus and keep the trigger "alive". Which will cause multiple plots in realtime if you don't add additional triggers. Am I missing something, or is there a simplier way of doing this?
Code: Select all
If condition1 = true
and condition2 = true
then begin
If (MarketPosition = 0)
then begin
// my plot
If Plot_Entry1_trigger = 0
then begin
Plot_Entry1_entryprice = close; // catch entryprice (set intrabarpersist)
Plot_Entry1_trigger = 1; // block plot trigger (set intrabarpersist)
end;
end; // end of If (MarketPosition = 0) Then begin
end; // end of If condition1 = true
If Plot_Entry1_trigger = 1
then begin
Entry1_Plot = Text_New_Dt(DateTime, Plot_Entry1_entryprice, "Entry1 Plot");
If barstatus(1) =2
then begin
Plot_Entry1_trigger = 0; // reset plot trigger
end;
end; // end of If Plot_Entry1_trigger = 1