point and figure code conversion to pine script

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #136818 quote
    picnicapicnica
    Participant
    New
    defparam cumulateorders = false
    
    ONCE uptrend = 1
    ONCE downtrend = 1
    
    n = 1
    
    Boxsize = 20
    
    turnafternn = 4
    LowerBorderBox = round((close / Boxsize) - 0.5) * Boxsize
    ONCE DowntrendLow = LowerBorderBox
    ONCE UptrendHigh = LowerBorderBox
    
    If LowerBorderBox > LowerBorderBox[1] then
    
    If uptrend = 1 then
    downtrend= 0
    ONCE DowntrendLow = LowerBorderBox
      If LowerBorderBox > UptrendHigh then
       UptrendHigh = LowerBorderBox
      endif
    endif
    
    If downtrend = 1 and LowerBorderBox >= DowntrendLow + (turnafternn * Boxsize) then
      UptrendHigh = LowerBorderBox
      uptrend = 1
      downtrend = 0
    endif
    
    elsif LowerBorderBox < LowerBorderBox[1] then
    
      If downtrend = 1 then
      uptrend = 0
      ONCE UptrendHigh = LowerBorderBox
       If LowerBorderBox < DowntrendLow then
        DowntrendLow = LowerBorderBox
       endif
      endif
    
      If uptrend = 1 and LowerBorderBox <= UptrendHigh - (turnafternn * Boxsize) then
       DowntrendLow = LowerBorderBox
       uptrend = 0
       downtrend = 1
      endif
    
    endif
    
    If uptrend = 1 and uptrend[1] = 0 then
    buy n contracts at market
    endif
    
    If downtrend = 1 and downtrend[1] = 0 then
    sellshort n contracts at market
    endif
    
    set stop ploss 350

     

    #136824 quote
    VonasiVonasi
    Moderator
    Master

    These forums are dedicated to ProRealCode. Conversion to ProRealCode is free. Conversion of ProRealCode to other languages is a paid for service. Use this link to ask for a price to convert any code to the language of your choice:

    https://www.prorealcode.com/free-code-conversion/

    Also please re-read the forum rules and always use the ‘Insert PRT Code’ button when putting code in your posts. I have edited your post to correct your error.

    Also a few words to politely make your request would be far politer than just posting a code and a topic title!

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

point and figure code conversion to pine script


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
picnica @picnica Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by VonasiVonasi
6 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/22/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...