I'm trying to find some code to prevent 2 plots at the same time when using an oscillator and updating tick by tick. - I should be getting only one plot at a given time increment but sometimes I get 2 . See attached .
Any suggestions ? (I'm not a programmer, so simple solutions or code, if possible)
Need code help
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times
TJ:
The Osc is the output from a neural net that I'm experimenting with- but the principal should be the same as any other oscillator.
***I think using the noplot command, I could clear out any extra plots but I'm not sure how to code it.
The Osc is the output from a neural net that I'm experimenting with- but the principal should be the same as any other oscillator.
Code: Select all
{ Now firing the network }
FireNet_Err = TSFireNet();
if (PutInput_Err <> 0) then print("Neural network firing error is", FireNet_Err:4:0);
{ Extract the predicted value from the DLL }
Nextday_Close = TSGetOutput(1); {neural net output}
if nextday_close > .500 then plot1(NextDay_Close, "ND_Close up");
if nextday_close < .500 then plot2(NextDay_Close, "ND_Close dn");
if nextday_close = .500 then plot3(NextDay_Close, "ND_Close =");
plot4(.500,"xvr");
end;
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
you don't need 3 plots.
probably you are using it for assigning different colors.
you can try this:
probably you are using it for assigning different colors.
you can try this:
var:
upcolor(cyan),
dncolor(red),
neucolor(green);
plot1(NextDay_Close, "ND_Close");
if nextday_close > .500 then setplotcolor(1, upcolor)
else
if nextday_close < .500 then setplotcolor(1, dncolor)
else
setplotcolor(1, neucolor);
plot4(.500,"xvr");
Last edited by TJ on 18 Nov 2009, edited 2 times in total.
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times
TJ: you're reading my mind, I tried that too, the picture that I posted was after trying that. (I forgot to mention it.)
It needs to know to only plot one at a time, in sequence. If I hit "status off" then "status on" it refreshes and erases the bad dot and looks correct for a little while.
If there was a way to detect the 2nd dot and if it was detected, to order a refresh, that might work. I just don't know how to code something like that.
It needs to know to only plot one at a time, in sequence. If I hit "status off" then "status on" it refreshes and erases the bad dot and looks correct for a little while.
If there was a way to detect the 2nd dot and if it was detected, to order a refresh, that might work. I just don't know how to code something like that.
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times
Thanks TJ, I understand. I can't do anything else, until I have fast rt quotes coming in(day session). I may set up a print log tomorrow and track the values and try to figure it out that way.
Another thing I might try is to say (if osc > .5 AND osc < .5 then noplot). That way it shouldn't allow 2 at the same time I hope.
Another thing I might try is to say (if osc > .5 AND osc < .5 then noplot). That way it shouldn't allow 2 at the same time I hope.
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
not sure which code you tried?TJ: you're reading my mind, I tried that too, the picture that I posted was after trying that. (I forgot to mention it.) ...
The first code? (with setplotcolor)
or the second code? (with noplot)
Thanks TJ, I understand. I can't do anything else, until I have fast rt quotes coming in(day session). I may set up a print log tomorrow and track the values and try to figure it out that way.
Another thing I might try is to say (if osc > .5 AND osc < .5 then noplot). That way it shouldn't allow 2 at the same time I hope.
the first code I posted (post#4) with the setplotcolor,
all you needed is only ONE plot.
Therefore there should not be another plot to give you false readings.
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times