I am using the following code
(after opening initial position long or strong)
****************************************
IF longonmarket and COUNTOFPOSITION <= 100 THEN
buy 1 perpoint at tradeprice(1)+x2 stop
endif
IF shortonmarket and COUNTOFPOSITION <= 100 THEN
sellshort 1 perpoint at tradeprice(1)-x2 stop
endif
profitstop =.9999*tradeprice(1)
profitstop1 =1.0001*tradeprice(1)
if longonmarket then
sell at profitstop stop
endif
if shortonmarket then
exitshort at profitstop1 stop
endif
********************
the code is working but not efficiently the I wanted.
I want to sell my all open long postions if prices goes down by 2 points( on spread betting account)
also I want to close my shot positions when price goes by 2 points
I dont see any option in PRT for this. ALL PRT just refers candles and time of current or previous, nth previous etc.
can you provide me some logic?
I tried the follwing also
if (positionperf-positionperf)<=.00012 then
sell at market
endif