Ichimoku Number Theory Fractals convert code to tradingviwe

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #176394 quote
    mohsentaha1994mohsentaha1994
    Participant
    New
    //Defparam calculateonlastbars = 5000
     
    // --- settings
    //ATRNumberHeight=10
    //FractalShoulderSize=14
    // --- end of settings
     
    once SwingLow=0
    once SwingLow2=0
    once SwingLow3=0
    once SwingHigh=0
    once SwingHigh2=0
    once SwingHigh3=0
    once i=0
    once j=0
    once k=0
    once lownext=1
    once highnext=0
     
    R = FractalShoulderSize //Fractal Shoulder Size
     
    //Adjusts distance of numbers above candles relative to timeframe
    atr = AverageTrueRange[ATRNumberHeight](close)[R]/pipsize
     
    //Identify the 1st swing low
    if not swinglow and lownext then
    IF low[R] < lowest[R](low) and low[R] < lowest[R](low)[R+1] Then
      SwingLow = low[R] //(R lower lows on left and R lower lows on right)
    Endif
    elsif swinglow>0 then
    i=i+1
    IF i=1 or i=9 or i=17 or i=26 or i=33 or i=42 or i=65 or i=76 or i=129 or i=172 or i=257 then
      drawtext("#i#",barindex-R+1,low[R+1]-(pipsize*ATR*4)) coloured(255,0,0)
       If i=172 or i=257 Then
        DRAWARROWUP(barindex-R+1,low[R+1]-(pipsize*ATR*2)) coloured(255,0,0)
       EndIf
    endif
    if i=257 then //65 42
      SwingLow=0
      i=0
      lownext=0
      highnext=1
    endif
    IF i>1 and not SwingLow2 and low[R] < lowest[R](low) and low[R] < lowest[R](low)[R+1] Then
      SwingLow2 = low[R] //(R lower lows on left and R lower lows on right)
    Elsif SwingLow>0 and SwingLow2>0  and not Swinglow3 then
      IF low[R] < lowest[R](low) and low[R] < lowest[R](low)[R+1] Then
       SwingLow3 = low[R] //(R lower lows on left and R lower lows on right)
      Endif
    endif
    endif
     
    if Swinglow2>0 then
    j=j+1
    IF j=1 or j=9 or j=17 or j=26 or j=33 or j=42 or j=65 or j=76 or j=129 or j=172 or j=257 then
      drawtext("#j#",barindex-4,low[R]-(pipsize*ATR*4)) coloured(0,255,0)
      If j=172 or j=257 Then
       DRAWARROWUP(barindex-R,low[R]-(pipsize*ATR*2)) coloured(0,255,0)
      EndIf
    endif
    if j=257 then //65 42
      SwingLow2=0
      j=0
    endif
    endif
     
    if Swinglow3>0 then
    k=k+1
    IF k=1 or k=9 or k=17 or k=26 or k=33 or k=42 or k=65 or k=76 or k=129 or k=172 or k=257 then
      drawtext("#k#",barindex-R,low[R]-(pipsize*ATR*4)) coloured(0,0,255)
      If k=172 or k=257 Then
       DRAWARROWUP(barindex-R,low[R]-(pipsize*ATR*2)) coloured(0,0,255)
      EndIf
    endif
    if k=257 then //65 42
      SwingLow3=0
      k=0
    endif
    endif
     
    //Identify the 1st swing high
     
    if not swinghigh and highnext then
    If high[R] > highest[R](high) and high[R] > highest[R](high)[R+1]  Then
      SwingHigh = high[R] //(R lower highs on left and R lower highs on right)
    Endif
    elsif swinghigh>0 then
      i=i+1
      IF i=1 or i=9 or i=17 or i=26 or i=33 or i=42 or i=65 or i=76 or i=129 or i=172 or i=257 then
       drawtext("#i#",barindex-R+1,high[R+1]+(pipsize*ATR*4)) coloured(255,0,0)
       If i=172 or i=257 Then
        DRAWARROWDOWN(barindex-R+1,high[R+1]+(pipsize*ATR*2)) coloured(255,0,0)
       EndIf
      endif
      if i=257 then //65 42
       Swinghigh=0
       i=0
       highnext=0
       lownext=1
      endif
      If i>1 and not SwingHigh2 and high[R] > highest[R](high) and high[R] > highest[R](high)[R+1]  Then
       SwingHigh2 = high[R] //(R lower highs on left and R lower highs on right)
      Elsif Swinghigh>0 and Swinghigh2>0 and not SwingHigh3 then
      If high[R] > highest[R](high) and high[R] > highest[R](high)[R+1]  Then
       SwingHigh3 = high[R] //(R lower highs on left and R lower highs on right)
      Endif
    endif
    endif
     
    if Swinghigh2>0 then
    j=j+1
    IF j=1 or j=9 or j=17 or j=26 or j=33 or j=42 or j=65 or j=76 or j=129 or j=172 or j=257 then
      drawtext("#j#",barindex-R,high[R]+(pipsize*ATR*4)) coloured(0,255,0)
      If j=172 or j=257 Then
       DRAWARROWDOWN(barindex-R,high[R]+(pipsize*ATR*2)) coloured(0,255,0)
      EndIf
    endif
    if j=257 then //65 42
      Swinghigh2=0
      j=0
    endif
    endif
     
    if Swinghigh3>0 then
    k=k+1
    IF k=1 or k=9 or k=17 or k=26 or k=33 or k=42 or k=65 or k=76 or k=129 or k=172 or k=257 then
      drawtext("#k#",barindex-R,high[R]+(pipsize*ATR*4)) coloured(0,0,255)
      If k=172 or k=257 Then
       DRAWARROWDOWN(barindex-R,high[R]+(pipsize*ATR*2)) coloured(0,0,255)
      EndIf
    endif
    if k=257 then //65 42
      Swinghigh3=0
      k=0
    endif
    endif
     
    return
    #176402 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Sorry, this forum is devoted to the ProRealTime platform only. Other platforms are not supported.

    For paid services https://www.prorealcode.com/trading-programming-services/.

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

Ichimoku Number Theory Fractals convert code to tradingviwe


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/28/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...