Thanks Andrew,
I did as you said and only one entry
was plotted in the chart (2011-02-22) and I got this message in Output:
====================
The date is 2015-01-19,
time is 17:00:00,
bar # is 1315.00,
current bar open is 1.16,
current bar high is 1.16,
current bar low is 1.16,
current bar close is 1.16,
market position on chart is 1.00,
market position at broker is 0.00,
Condition1 is false, so no order is generated.
======================
But I dont understand how that can help me. I should say that I am backtestning, no live trading. Do you think it is something wrong with the code (Bar Magnifier 1 second), here is the complete code:
Code: Select all
[IntrabarOrderGeneration=True]
Inputs:
Losslong(0.0010),
PTlong(0.0010);
Vars: Buyprice(0);
Condition1= L<L[1] AND Marketposition = 0;
If Condition1 then Buyprice = H[1] + 0.0001;
If Condition1 AND (barssinceexit(1) >1 OR totaltrades <1) Then buy ("Long") next bar at Buyprice stop;
If Marketposition = 1 then sell ("PTlong") next bar from entry ("Long") at entryprice + PTlong or higher;
If Marketposition = 1 then Sell ("SLlong") next bar from entry ("Long") at entryprice - Losslong or lower;