Fix a value in time

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18519 quote
    MDSMDS
    Participant
    Junior

    Hi All,
    I need to fix a value in certain condition till another condition happens.
    For example I want to fix the value of the price ((close+open)/2) when the price crosses a MA… then when another condition happens I reset this value.
    I’d like to know how to do without tricky condition checking.
    once reserved word was not useful.
    I repeat
    priceAtCross = (open+close)/2

    I’d want to fix that value at that time whitout using indexes or too much complicate if then endif statements

    Thank You.

    Regards,
    Mauro

    #18684 quote
    tikitakatikitaka
    Participant
    Average

    Hi, as simple as counting  up to 3:

    if somePrice crosses over someMA then
    if priceAtCross = yourResetValue then   // 0 or whatever reset value
    priceAtCross = (open+close)/2
    endif
    // your instructions
    endif
    
Viewing 2 posts - 1 through 2 (of 2 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

Fix a value in time


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
MDS @mds Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by tikitakatikitaka
9 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/14/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...