NexusFi: Find Your Edge


Home Menu

 





Trading System...to improve


Discussion in EasyLanguage Programming

Updated
    1. trending_up 2,040 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Trading System...to improve

  #1 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129

Hi,

I would like to improve this Trading System which I think is interesting,
I would like, if possible, to reduce the false signals in the very narrow lateral phases;

I was thinking of a filter of this type, to reduce these false signals:

after a Buy signal, the Short signal has to wait for at least 3 candles;

after a short signal, the Buy signal must wait for at least 3 candles.

After 3 candles, the Trading System proceeds normally as always.

This is the formula:

---------------------------------------------------

Inputs: Length(30), len2(4), len3(4), protStop(1300);

vars:
daysintrade(0),atr(0),ptargmult(1),longliqpt(0), shortliqpt(9999999), protlongstop(0), protshortstop(0), lowestlow3(0),highesthigh3(0),bed
(0),sed(0),stb(0), sts(0);

atr=avgtruerange(Length);
lowestlow3=lowest(low,len2);
highesthigh3=highest(high,len3);
bed=0;
sed=0;

if (close>=close[1]) then sed=1;
if (close<=close[1]) then bed=1;
if(bed=1) then
begin
stb=open of tomorrow +.5*(highesthigh3-lowestlow3);
sts=open of tomorrow -(highesthigh3-lowestlow3);
end;

if(sed=1) then
begin
stb=open of tomorrow +(highesthigh3-lowestlow3);
sts=open of tomorrow -.5*(highesthigh3-lowestlow3);
end;

if (marketposition=1 and barssinceentry=0) then
protlongstop=entryprice(0)-3*atr[1];
if (marketposition=-1 and barssinceentry=0) then
protshortstop=entryprice(0)+3*atr[1];

if (marketposition<>marketposition(1)) then
begin
ptargmult=1;
longliqpt=0;
shortliqpt=999999;
end;

if (marketposition=1 and high[1]>entryprice(0)+ (3*atr[1])) then
begin
longliqpt=entryprice(0);
end;
if (marketposition=-1 and low[1]<entryprice(0)- (3*atr[1])) then
begin
shortliqpt=entryprice(0);
end;

buy tomorrow at stb stop;
sellshort tomorrow at sts stop;

SetStopLoss(protStop);

---------------------------------------------------

I thank you in advance.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #2 (permalink)
 Miesto 
Monte Carlo, Monaco
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage
Trading: Futures
Posts: 647 since May 2012
Thanks Given: 801
Thanks Received: 1,194

https://www.geeksforgeeks.org/suspending-the-current-thread-for-the-specified-amount-of-time-in-c-sharp/

Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129




The Trading System formula is in EasyLanguage, not C# (it works perfectly with Tradestation).

Reply With Quote
  #4 (permalink)
 Miesto 
Monte Carlo, Monaco
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Broker: NinjaTrader Brokerage
Trading: Futures
Posts: 647 since May 2012
Thanks Given: 801
Thanks Received: 1,194

In case you're still looking for how to add a pause here's an example in EasyLanguage:

Tutorial 74 | Introducing a strategy ‘pause’ after sequential losing trades

Tutorial 74 | Creating a strategy pause based on certain events VIDEO

I think it really is always the same, you use a command (like 'sleep' or 'pause', if available) or create an iteration loop (For.., While.., Repeat/Until) with a counter. Anyways, hope it helps, good luck.

-Mich

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on May 1, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts