NexusFi: Find Your Edge


Home Menu

 





no trades registered-- Help


Discussion in EasyLanguage Programming

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




 
Search this Thread

no trades registered-- Help

  #1 (permalink)
wherdendorf
harlingen texas
 
Posts: 8 since Nov 2022
Thanks Given: 4
Thanks Received: 0

A little help with this. trying a correlation trade with data2,data3 to post trades to data1. This script only has buy/sell/signals at beginning and end of day.
Objective.....data2/data3 has same bullish/bearish signals then buy/sell short next bar data1.

Inputs: cntrcts(1); Setexitonclose;
condition1= close data2>open data2;
condition2= close data3>open data3;
condition3= close data2<open data2;
condition4=close data3<open data3;
if time=0800 then begin;
if condition1 =condition2 then buy next bar at open;
if condition3=condition4 then sell short next bar at open;
end;

No trades registered between begin and exit. Yes, using 2 minute bars.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
NexusFi Journal Challenge - May 2024
Feedback and Announcements
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
32 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #2 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,664 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,359


wherdendorf View Post
A little help with this. trying a correlation trade with data2,data3 to post trades to data1. This script only has buy/sell/signals at beginning and end of day.
Objective.....data2/data3 has same bullish/bearish signals then buy/sell short next bar data1.

Inputs: cntrcts(1); Setexitonclose;
condition1= close data2>open data2;
condition2= close data3>open data3;
condition3= close data2<open data2;
condition4=close data3<open data3;
if time=0800 then begin;
if condition1 =condition2 then buy next bar at open;
if condition3=condition4 then sell short next bar at open;
end;

No trades registered between begin and exit. Yes, using 2 minute bars.

I would take the semicolon out after "begin" but not sure if that is the issue.

I would try debugging with print statement:

print(date," ",time," ",condition1," ",condition2, " " ,condition3," ",condition4);


and realize as written this strategy can ONLY take trades at 800. Not sure if this is what you want...

Follow me on Twitter Reply With Quote
  #3 (permalink)
wherdendorf
harlingen texas
 
Posts: 8 since Nov 2022
Thanks Given: 4
Thanks Received: 0


Thank you for quick response. As you can tell I am new to this language. Having removes the begin statement from the
script the chart traded as it should. Problem is I want this to start to monitor conditions at 0800 and close or flatten all positions at 1500 so as to keep in day trade session. It was funny to me as the begin statement would cause order to be created at 0802. How did this happen with the begin statement especially when the script did not meet any conditions yet(long or short order). If I should not use a begin statement, then what should be used to get the desired effect of trading between 0800 and 1500?

Again thanks for looking at this novices problems.

Reply With Quote
  #4 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,664 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,359

So when you say if time=800 then buy next bar; it will buy at 8:00:001, which is the start of the 8:02 bar. bar time is noted by the end time of the bar.

You might want to use: if time>=800 and time<1500 that would be active between 800 and 1500

to make sure you exit at end of day:

if time=1500 then begin
sell next at market;
buytocover next bar at market;
end;

you might also want to change 1500 to 1458, since it the market actually closes at 1500, if you have time=1500 then order would get sent after market closed.

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on February 5, 2023


© 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