Enter position only once for a level

Forums ProRealTime English forum ProOrder support Enter position only once for a level

Viewing 2 posts - 1 through 2 (of 2 total)
  • #232319

    Hi,

    I want to trade a level only once and do not want to enter the trade same level twice. But below code isn’t working:

    RTHoperate = (TIME > 142000 AND TIME < 203000) // GMT+1

    if time < 143000 then
    spread = 2
    else
    spread = 1
    endif

    MyLongPrice = round(max(myBarLower, myBarUpper))
    distance = abs(myBarHigh – myBarLow)

    if NOT ONMARKET and RTHoperate and close > MyLongPrice then  and (MyLongPrice <> tradeprice[1]) then

    SET STOP PLOSS distance + spread
    set target pprofit distance*20
    endif

    Above code (if no market …) keep rentering the same location.

    2nd question: If i want to go long using the same myLongPrice twice, what protection I can put in the code?

    Regards

    Ash

    #232345

    You can use the previous entry price exactly, but the two prices are unlikely to be identical, even to the decimal point!
    This example divides the price by 100 (but you can change it to 50 or 10, etc…), in this way it is easy for the price of the new entry to be in the same range as the previous one and therefore the entry is not made:

     

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login