Formular execution in traing StopLoss

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #197303 quote
    NacoNacoNacoNaco
    Participant
    New

    Hi,

    I have added the following code:

    weightedStop = WeightedAverage[14](AverageTrueRange[2](close))*2
    SET STOP PTRAILING weightedStop

    I am using 15minute timeframe. Now I was expecting to have “weightedStop” being calculated every 15minutes and for the next 15minutes the calculated value will be used as trailing stop loss. Instead the trailing stop loss is changing throught a 15 minute candle, therefor I guess that the formular is constantly recalculating the stop loss value, because I set a formular that is depending on weightedaverages, which is “changing” with every tick.
    Am I understanding this correctly?
    If so, how can I workaround this? I am thinking of something like “value(weightedStop)”, but I wasn’t able to find anything close in the documentation.

    Thank you,
    Nico

    #197317 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    If you are using multiple time frames, then it depends on which TIMEFRAME instruction you placed the two lines.

    If you are not using multiple time frames it should not change as strategies are only executed at the closing of the 15-minute candle.

    #197624 quote
    GraHalGraHal
    Participant
    Master

    Roberto, does not SET STOP PTRAILING (used in code above) execute / move at each 1 point move in price (i.e. not wait until close of bar) after – in the case above – weightedStop condition has been met? 

    Put another way, TS Start = price moves by >= weightedStop then TS follows price for each 1 point move in price.

    #197642 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Yes, you are right GraHal, it’s the TS start that moves each bar, while the step is always set to 1.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Formular execution in traing StopLoss


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
NacoNaco @naconaco Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
4 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/15/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...