buy lotsize contract at high-(range*.5) stop

Forums ProRealTime English forum ProOrder support buy lotsize contract at high-(range*.5) stop

Currently, there are 0 users and 1 guest visiting this topic.
View all attachments
Viewing 6 posts - 1 through 6 (of 6 total)
  • #198890 Report

    Hi, could somebody please explain what the following lines of coding mean:

    if not longonmarket and buyc2 then
    if range>SignalLargerThan*pointsize Then
    buy lotsize contract at high-(range*.5) stop

     

    and

     

    if not shortonmarket and sellc2 then
    if range>SignalLargerThan*pointsize Then
    sellshort lotsize contract at low+(range*.5) stop
    else

     

    I think i get the most of it it’s just these parts i don’t understand…  buy lotsize contract at high-(range*.5) stop

    sellshort lotsize contract at low+(range*.5) stop

     

    If i change the (range*.5) to (range*.0) i get different results…  I’m trying to get my head around exactly how the code is executing trades on a backtest.

     

    #198893 Report

    RANGE*0.5 is just a variable offset to enter a trade. You can write a fixe4d value, such as 20*PipSize.
    It means that it will BUY at HIGH – x or SELLSHORT at LOW + x.
    You can use any expression of your choice, could be ATR or any other valid offset.

    #198906 Report

     

    Thanks for your response

    Does this mean it creates a market order + x or – x from the close of the previous  candle? And the x value is however much I want the offset to be?

    so if I don’t want an offset and set it to .0 will the trades be executed immediately?

     

     

    #198912 Report

    Yes, 0 will remove the offest.

    The offeset is based on the RANGE of the candle, so it is not fixed.

     

    #198923 Report

    Ok thanks. In this case what would the relationship be between the range of the candle and where the market order gets placed?

    is it based on the range of the candle which produces the signal?

    I have the: if range>SignalLargerThan*pointsize  set to 0 in variable optimisation

     

    #198926 Report

    is it based on the range of the candle which produces the signal?  Yes 

    what would the relationship be between the range of the candle and where the market order gets placed?  It’s the multiplier x.x, be it 0 or 0.5

    If SignalLargerThan is set to 0, then the condition  IF RANGE >… will always be true.

     

     

     

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

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