I have a Iconic variable BackWallBoundaryLineXLD
It containts 2 points and the line connecting them.
I would need to move this line upwards 40 pixels, so basically change the row coordinate of the line to Currentvalue-40.
Is there a simple and clean way to do it, or do I have to extract the points first, edit them and then draw a new line?
Try
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_translate (HomMat2DIdentity, -40, 0, HomMat2DTranslate)
affine_trans_contour_xld (BackWallBoundaryLineXLD, BackWallBoundaryLineXLDTranslated, HomMat2DTranslate)
Try using affine_trans_contour_xld(). You will have to setup a HomMat3D first that specifies your 40pixel translation.
Related
I'm using the react-native-qrcode-svg package, but when I try to implement a simple QR code, this image returns.
I already tried removing all the styles, but keep returning the same image,
this is the code that i am using
<QRCode value="http://awesome.link.qr"/>
UPDATE
I was reviewing the code of the package and I noticed that it uses the Path to draw each box, check in the documentation and for some reason it has the property by default
strokeLinecap={'square'}
I had to specify that it was square, I also had to modify the width and height of each square, because they are poorly positioned.
I did that in the file
./node_modules/react-native-qrcode-svg/src/transformMAtrixIntoPath.js
I really don't know if I did it right, or there is another way much easier to solve, but for the moment that solved it
For someone who has the same problem, I fixed it like this:
ADD strokeLinecap={'square'} on Line 141, as property of at index.js file
Head to tranformMatrixIntoPath.js file and modify the algorithm
UPDATE Line 2 add const cellSize = size / matrix.length - 0.1
UPDATE Line 9 add path += 'M${cellSize * j + 9} ${cellSize / 2 + cellSize * i}'
I am trying to write a pine script with two indicators one overlaid on the chart (EMA) and another on its own?(Stoch) I cannot seem to find any info on how to separate these (Visually) but keep them within 1 pine script, ie to be able to take trading decisions based on these.
The earlier answer from Luc is right, unfortunately. Each script can either create plots that are overlaid on the default price chart, or shown in a different pane, but not both. But there is a workaround.
Suppose you've made some non-trivial calculation in your script and you'd like to put it in different pane. E.g. the next code:
//#version=4
study(title="Stochastic", shorttitle="Stoch", format=format.price, precision=2)
periodK = input(14, title="K", minval=1)
periodD = input(3, title="D", minval=1)
smoothK = input(3, title="Smooth", minval=1)
k = sma(stoch(close, high, low, periodK), smoothK)
d = sma(k, periodD)
plot(k, title="%K", color=color.blue)
plot(d, title="%D", color=color.orange)
h0 = hline(80)
h1 = hline(20)
fill(h0, h1, color=color.purple, transp=75)
// This next plot would work best in a separate pane
someNonTrivialCalculatedSeries = close
plot(ema(someNonTrivialCalculatedSeries, 25), title="Exporting Plot")
Because they have different scale, one of them most likely will break another indicator's scale.
So you'd like show Stoch in different pine, whereas ema() should be overlayed with the main chart. For that you should make the next steps:
Turn off in the study's the extra plot to return scale to normal:
Apply to the chart the next script:
//#version=4
study("NonOverlayIndicator", overlay=true)
src = input(defval=close, type=input.source)
plot(src)
Choose in the second's script inputs source required plot from the first script:
And voilĂ - you got the plots in different pines:
But if you want split the plots because you have retrictions on amount of studies you allowed to apply (e.g. 3 for free-account) - that won't help you.
It cannot be done. A script runs either in overlay=true mode on the chart, in which case it cannot direct plots elsewhere, or in a separate pane when overlay=false (the default).
When the script is running in a pane, it can change the color of the chart bars using barcolor(), but that's the only way it can modify the chart.
It is possible to rescale signals so that multiple bounded (e.g., 0-100, -1 to +1) signals generated by one script appear one on top of the other, but this is typically impossible in overlay mode, as the vertical scale varies with the bars on the chart. The only way for an overlay script to work with its own scale is when it uses No scale, but this prevents the indicator's plots to plot relative to price, and so the chart's bars.
Nice workaround from Michael.
Unfortunately, this only seems to work to pass data for one plot.
I would like to pass data for 3 different plots to the stock price graph.
If I try this, for 'input.source' I can only select the standard sources: "open, high, low, close ...". I can not select the data from other indicators.
If I remove plots 2 and 3, it works as Michael described.
Anybody has a workaround for the workaround..? ;-)
In core platform ,i am using SKPATH instead of GRAPHICSPATH(SYSTEM.DRAWING) but i cant add the line in the SKPATH.`
Path.AddLine(x,y) //Addline is showing error where path refers to the SKPATH
Is there any other alternative solution for adding the line in the SKPATH.
Thanks,
SkiaSharp sometimes uses a few different terms. What you want is probably:
var path = new SKPath();
// start the path somewhere
path.MoveTo(0, 0);
// draw a line from (0,0) to (10,0)
path.LineTo(10, 0);
// draw another line from (10,0) to (10,10)
path.LineTo(10,10);
There are a few other members, but they basically follow a pattern of AddXXX for closed shapes (eg AddRect, AddOval), and XXXTo for line segments (eg LineTo, ArcTo).
I am trying to use scripting in praat to either save or write to a file with the values given from using "Pitch Listing" under "Pitch". This is my code for the script so far:
selectObject: 1
View & Edit
editor: 1
Select: 0.0, 10000
Pitch listing
p$ = Get pitch
fileappend pitch123.txt 'p$'
This code only returns the mean for the sound file and I am wondering if there is a way to avoid getting small chunks of the file and getting the average pitch and instead being able to get the data given the way praat does it like so :
Time_s F0_Hz
0.254558 125.982312
0.264558 127.975510
0.274558 123.010164
0.284558 120.761760
0.294558 119.652539
0.304558 118.916850
Even just being able to save the file that pops up from "Pitch Listing" would work. Any help is appreciated. Thanks!
Using the new syntax (Praat >= 5.3.63), you can create a Pitch object and loop through the frames to get the Pitch value for that frame (by default, one frame every 10 msec).
writeFileLine: "./pitch_list.txt", "time,pitch"
selectObject: 1
To Pitch: 0, 75, 600
no_of_frames = Get number of frames
for frame from 1 to no_of_frames
time = Get time from frame number: frame
pitch = Get value in frame: frame, "Hertz"
appendFileLine: "pitch_list.txt", "'time','pitch'"
endfor
Is it possible to use Console.Write to place a single character at the very bottom right of a typical 80x25 console, without having the console scroll the row up? This is the code that I'm using...
Imports System
Console.SetCursorPosition(Console.WindowWidth-1, Console.WindowHeight-1)
Console.Write("x")
This is not working like I would like it to. Any suggestions or alternatives? I've tested that SetCursorPosition does use a 0,0 coordinate system, already. Using the WindowWidth-1/Height-1 should put me in the lower right corner of the screen... which it does, but then Console.Write is putting the "x" down and continuing on to the next line.
You can try moving the buffer area. For example:
Console.WriteLine("Top")
Console.SetCursorPosition(Console.WindowWidth - 1, Console.WindowHeight - 1)
Console.Write("x")
Console.MoveBufferArea(0, 0, 80, 25, 0, 1)
Console.ReadLine()
The problem is that whenever you write to the last location in a particular line, the console always moves you to the next line. The closest thing you can do is write to the second last location:
Console.CursorLeft = Console.WindowWidth - 1;
Console.Write("X");
I solved it in a dirty but functional way.
Console.SetCursorPosition(79, 24); //last pos
Console.BufferWidth++;
Console.Write("x");
Console.BufferWidth--;
Console.ReadKey();
the side of the box does flicker a millisecond, but I don't think anyone will ever notice :)