Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now, It is Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
Available coupon codes for premium Elite Membership:
If you are a researcher and pay attention to details, you qualify for our 10% discount - "CHARTIST"
If you are a veteran or in public/community service, you qualify for 15% discount - "PURPLECHART"
If you are 60+ years old, you qualify for our 20% discount - "WISDOM"
Discounts are based on the honor system. If we can't trust you to do the right thing, please move along.
(If you already have an account, login at the top of the page)
Hi guys, I’m quite new to programming and need some help for a system I’m trying to code.
I want the TS to buy at MovingAverage – X points (first trade).
Then buy every time the price drops Y points following a “grid style”.
Example:
X = 40
Y = 30 Moving average @ 240
First buy limit @ 200
Second buy limit @ 170
Third buy limit @ 140
4th buy limit @ 110
5th buy limit @ 80
6th….
And close all open positions once the price touch the MovingAverage.
This is the code I tried to write:
The problems I find are:
1) The levels aren’t always respected (honestly I can’t understand why sometime the levels are correct and sometime not)
2) In this way (next bar limit) the orders are executed no more than once per bar, even if a single bar drop more than Y points (that would mean more than a single trade per bar)
Can you guys please help me with this code?
Thank you in advance
Can you help answer these questions from other members on NexusFi?
hi mwtzzz, I think I can exclude that the different levels the TS buys are due to better price fills because it happens for example that the TS buys few candles after the candle that closed under the theoretical price to buy..
example: the TS bought at 130, next theoretical price to buy is 100
it happens that there are candles that close at let's say 95 and the TS still don't buys the next contract...