point and figure code conversion to pine script

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #136818 quote
    picnica
    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
    Vonasi
    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.

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 Vonasi
5 years, 9 months ago.

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