code help on scalping
Forums › ProRealTime English forum › ProOrder support › code help on scalping
- This topic has 6 replies, 2 voices, and was last updated 3 years ago by Vonasi.
-
-
04/28/2020 at 1:10 PM #128614
I want to use this code for trading, the problem with this I need to monitor screen to see when the signal is generated
https://www.prorealcode.com/prorealtime-indicators/scalping-with-parabolic-sar-and-fibonacci/
I tried to added
on line 42 as k1=1
online 57 as k1=-1
online 74 return sarfast coloured(r,g,0) style(point,5),sarslow coloured(0,195,255) style(point,5),k1
I am not getting error or on the other hand I am not getting any signal either
This logic has excellent success ratio
04/28/2020 at 1:19 PM #128619It will just be drawing a line between -1 and 1 right at the bottom of the chart window so that is why you probably can’t see it. Remove all the graphical instructions and change the last line to RETURN k1 and then apply it as a separate indicator window and you will see it.
You may want to add a k1 = 0 at the start of the code unless you just want it to be 1 or -1.
04/28/2020 at 1:57 PM #128630removed the graphs but it not giving the signal as expected
scalpingmodified12345678910111213141516171819202122232425262728293031323334353637//PRC_Scalping with Parabolic SAR and Fibonacci | indicator//03.09.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// --- settings// --- end of settingssarfast=SAR[0.02,0.02,0.2]sarslow=SAR[0.005,0.005,0.05]//highs and lowsif close<sarfast thenll=min(ll,low)elsehh=max(hh,high)endifif close>sarfast and close[1]<sarfast[1] then //new bullish signalll=sarslow //reset llif close>sarslow thenk1=-1endifendifif close<sarfast and close[1]>sarfast[1] then //new bearish signalhh=0 //reset hhif close<sarslow thenk1=1endifendifreturn k104/28/2020 at 2:57 PM #128645You haven’t really clearly explained what you expect it to do. Plus your image tells us nothing because most of the charts with the actual values is missing completely.
If you just want the return to be a spike at +1 or -1 then you have to set the k1 back to zero at the start of the code.
04/28/2020 at 3:40 PM #128668please find attached the screen shot marked in blue. original code gives the signal at the time of blue marks.
that signal is valid for some time may be 10 or 2o min
I want a spike at the time of signal generated . I will place an order by looking at alert.
if I can get entry , target and stop loss also i will good . I can write program
as
call the indicator and when k=1
buy at entry+x limit
sell at stop-x stop
sell at target-x limit
x= 1
04/28/2020 at 5:33 PM #128707You will need to have in your strategy keep placing pending orders at every bar anyway because they only last one bar – so you will need it to remain at +1 or -1 unless you are on market. To be honest you are best to code the indicator into your strategy. It will make it easier because you will need to switch the value to zero if a trade opens.
My platform is closed at the moment and I’m a bit busy with other stuff otherwise I would just write it for you!
04/29/2020 at 8:13 AM #128762I think that this should do what you want as a strategy. I kept the ‘plotbar’ setting in the code so it only places pending BUY or SELLSHORT orders on the market for this number of bars after a set up has been identified.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768//PRC_Scalping with Parabolic SAR and Fibonacci strategy// --- settingsplotbar=10 //bars duration for placing orders// --- end of settingssarfast=SAR[0.02,0.02,0.2]sarslow=SAR[0.005,0.005,0.05]//highs and lowsif close<sarfast thenll=min(ll,low)elsehh=max(hh,high)endifif close>sarfast and close[1]<sarfast[1] then //new bullish signalfibo0=llll=sarslow //reset llif close>sarslow thenstartbar=barindexirange=high-fibo0entry = fibo0+(irange/2)itarget = fibo0+irange*1.618istop = fibo0-2*pointsizesignal = 1endifendifif close<sarfast and close[1]>sarfast[1] then //new bearish signalfibo0=hhhh=0 //reset hhif close<sarslow thenstartbar=barindexirange=fibo0-lowentry = fibo0-(irange/2)itarget = fibo0-irange*1.618istop = fibo0+2*pointsizesignal = -1endifendifif barindex-startbar<=plotbar thenif not onmarket and close>sarslow and signal = 1 then //bullish trendbuy 1 contract at entry limitsell at istop stopsell at itarget limitendifif not onmarket and close<sarslow and signal = -1 then //bearish trendsellshort 1 contract at entry limitexitshort at istop stopexitshort at itarget limitendifendifif longonmarket thensignal = 0sell at istop stopsell at itarget limitendifif shortonmarket thensignal = 0exitshort at istop stopexitshort at itarget limitendifgraph signal -
AuthorPosts
Find exclusive trading pro-tools on